Xie XiuQi
79c350e45e
xfs: fix signed integer overflow
Use 1U for unsigned int to avoid a overflow warning from UBSAN.
[ 31.910858] UBSAN: Undefined behaviour in fs/xfs/xfs_buf_item.c:889:25
[ 31.911252] signed integer overflow:
[ 31.911478] -2147483648 - 1 cannot be represented in type 'int'
[ 31.911846] CPU: 1 PID: 1011 Comm: tuned Tainted: G B ---- ------- 3.10.0-327.28.3.el7.x86_64 #1
[ 31.911857] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 01/07/2011
[ 31.911866] 1ffff1004069cd3b 0000000076bec3fd ffff8802034e69a0 ffffffff81ee3140
[ 31.911883] ffff8802034e69b8 ffffffff81ee31fd ffffffffa0ad79e0 ffff8802034e6b20
[ 31.911898] ffffffff81ee46e2 0000002d515470c0 0000000000000001 0000000041b58ab3
[ 31.911913] Call Trace:
[ 31.911932] [<ffffffff81ee3140>] dump_stack+0x1e/0x20
[ 31.911947] [<ffffffff81ee31fd>] ubsan_epilogue+0x12/0x55
[ 31.911964] [<ffffffff81ee46e2>] handle_overflow+0x1ba/0x215
[ 31.912083] [<ffffffff81ee4798>] __ubsan_handle_sub_overflow+0x2a/0x31
[ 31.912204] [<ffffffffa08676fb>] xfs_buf_item_log+0x34b/0x3f0 [xfs]
[ 31.912314] [<ffffffffa0880490>] xfs_trans_log_buf+0x120/0x260 [xfs]
[ 31.912402] [<ffffffffa079a890>] xfs_btree_log_recs+0x80/0xc0 [xfs]
[ 31.912490] [<ffffffffa07a29f8>] xfs_btree_delrec+0x11a8/0x2d50 [xfs]
[ 31.913589] [<ffffffffa07a86f9>] xfs_btree_delete+0xc9/0x260 [xfs]
[ 31.913762] [<ffffffffa075b5cf>] xfs_free_ag_extent+0x63f/0xe20 [xfs]
[ 31.914339] [<ffffffffa075ec0f>] xfs_free_extent+0x2af/0x3e0 [xfs]
[ 31.914641] [<ffffffffa0801b2b>] xfs_bmap_finish+0x32b/0x4b0 [xfs]
[ 31.914841] [<ffffffffa083c2e7>] xfs_itruncate_extents+0x3b7/0x740 [xfs]
[ 31.915216] [<ffffffffa08342fa>] xfs_setattr_size+0x60a/0x860 [xfs]
[ 31.915471] [<ffffffffa08345ea>] xfs_vn_setattr+0x9a/0xe0 [xfs]
[ 31.915590] [<ffffffff8149ad38>] notify_change+0x5c8/0x8a0
[ 31.915607] [<ffffffff81450f22>] do_truncate+0x122/0x1d0
[ 31.915640] [<ffffffff8147beee>] do_last+0x15de/0x2c80
[ 31.915707] [<ffffffff8147d777>] path_openat+0x1e7/0xcc0
[ 31.915802] [<ffffffff81480824>] do_filp_open+0xa4/0x160
[ 31.915848] [<ffffffff81453127>] do_sys_open+0x1b7/0x3f0
[ 31.915879] [<ffffffff81453392>] SyS_open+0x32/0x40
[ 31.915897] [<ffffffff81f08989>] system_call_fastpath+0x16/0x1b
[ 240.086809] UBSAN: Undefined behaviour in fs/xfs/xfs_buf_item.c:866:34
[ 240.086820] signed integer overflow:
[ 240.086830] -2147483648 - 1 cannot be represented in type 'int'
[ 240.086846] CPU: 1 PID: 12969 Comm: rm Tainted: G B ---- ------- 3.10.0-327.28.3.el7.x86_64 #1
[ 240.086857] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 01/07/2011
[ 240.086868] 1ffff10040491def 00000000e2ea59c1 ffff88020248ef40 ffffffff81ee3140
[ 240.086885] ffff88020248ef58 ffffffff81ee31fd ffffffffa0ad79e0 ffff88020248f0c0
[ 240.086901] ffffffff81ee46e2 0000002d02488000 0000000000000001 0000000041b58ab3
[ 240.086915] Call Trace:
[ 240.086938] [<ffffffff81ee3140>] dump_stack+0x1e/0x20
[ 240.086953] [<ffffffff81ee31fd>] ubsan_epilogue+0x12/0x55
[ 240.086971] [<ffffffff81ee46e2>] handle_overflow+0x1ba/0x215
...
Signed-off-by: Xie XiuQi <xiexiuqi@huawei.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
2016-09-14 07:41:16 +10:00
..
2016-08-07 10:01:14 -04:00
2016-08-07 10:01:14 -04:00
2016-07-31 16:37:25 -04:00
2016-06-10 18:14:47 -07:00
2016-08-06 09:49:02 -04:00
2016-05-23 17:04:14 -07:00
2016-05-09 11:41:14 -04:00
2016-08-10 11:16:03 -07:00
2016-08-03 13:33:26 -04:00
2016-08-09 17:26:56 +02:00
2016-07-31 16:37:25 -04:00
2016-05-29 19:08:00 -04:00
2016-07-10 21:02:18 +09:00
2016-05-09 11:41:14 -04:00
2016-06-07 13:41:38 -06:00
2016-06-30 23:34:49 -04:00
2016-06-23 15:47:31 -05:00
2016-06-23 11:55:58 -05:00
2016-07-08 10:35:28 -05:00
2016-07-31 16:37:25 -04:00
2016-05-20 17:58:30 -07:00
2016-06-07 13:41:38 -06:00
2016-05-02 19:49:29 -04:00
2016-08-06 09:49:02 -04:00
2016-07-28 12:59:05 -07:00
2016-08-06 09:49:02 -04:00
2016-08-07 10:01:14 -04:00
2016-06-13 10:20:39 +02:00
2016-06-30 23:34:49 -04:00
2016-08-06 09:49:02 -04:00
2016-08-07 10:03:31 -04:00
2016-08-07 10:01:14 -04:00
2016-08-07 10:01:14 -04:00
2016-08-04 00:18:10 +02:00
2016-07-31 16:37:25 -04:00
2016-04-04 10:41:08 -07:00
2016-07-31 16:37:25 -04:00
2016-07-26 18:35:55 -07:00
2016-06-10 20:21:46 -07:00
2016-07-31 16:37:25 -04:00
2016-07-29 15:54:19 -07:00
2016-07-28 12:59:05 -07:00
2016-08-06 09:49:02 -04:00
2016-05-02 19:49:32 -04:00
2016-07-31 16:37:25 -04:00
2016-08-12 12:32:24 -07:00
2016-08-12 16:10:25 -04:00
2016-08-02 19:35:21 -04:00
2016-05-19 19:12:14 -07:00
2016-07-28 12:59:05 -07:00
2016-08-06 09:49:02 -04:00
2016-05-09 11:41:14 -04:00
2016-05-09 11:41:14 -04:00
2016-08-02 15:39:13 -04:00
2016-07-29 12:05:25 +02:00
2016-08-11 16:58:13 -07:00
2016-08-05 11:21:46 -07:00
2016-05-09 11:41:14 -04:00
2016-05-09 11:41:14 -04:00
2016-07-29 15:54:19 -07:00
2016-05-20 17:58:30 -07:00
2016-08-02 19:35:22 -04:00
2016-05-09 11:41:15 -04:00
2016-06-07 13:41:38 -06:00
2016-06-23 15:41:56 -05:00
2016-06-10 20:21:46 -07:00
2016-05-29 16:22:07 -04:00
2016-07-29 23:32:37 +02:00
2016-07-26 15:37:51 -07:00
2016-07-28 12:59:05 -07:00
2016-09-14 07:41:16 +10:00
2016-05-23 17:04:14 -07:00
2016-07-05 15:06:46 -05:00
2016-05-27 20:09:16 -04:00
2016-05-28 16:34:59 -07:00
2016-07-25 16:51:49 +10:00
2016-08-02 19:35:14 -04:00
2016-08-02 19:35:15 -04:00
2016-07-28 13:29:12 +10:00
2016-08-07 10:13:14 -04:00
2016-08-07 14:41:02 -06:00
2016-07-27 09:53:35 -07:00
2016-07-14 16:21:53 +09:00
2016-06-28 10:00:13 -03:00
2016-05-24 12:55:26 -07:00
2016-06-07 22:07:09 -04:00
2016-07-28 17:38:16 -07:00
2016-08-07 10:01:14 -04:00
2016-06-07 13:41:38 -06:00
2016-03-22 15:36:02 -07:00
2016-05-19 19:12:14 -07:00
2016-08-04 18:04:44 -04:00
2016-01-09 02:55:37 -05:00
2016-03-22 15:36:02 -07:00
2016-05-02 19:49:28 -04:00
2016-01-19 12:02:23 -05:00
2016-08-09 19:58:06 -06:00
2016-08-07 10:01:14 -04:00
2016-08-07 10:13:14 -04:00
2016-07-28 15:23:12 -07:00
2016-08-29 11:33:58 +10:00
2016-08-04 19:59:06 -04:00
2016-07-28 13:29:13 +10:00
2016-06-20 17:11:29 -04:00
2016-07-01 10:24:18 -04:00
2016-06-21 09:23:11 +10:00
2016-02-22 22:44:04 -05:00
2016-08-07 14:41:02 -06:00
2016-08-07 10:03:31 -04:00
2016-07-29 15:54:19 -07:00
2015-09-11 15:21:34 -07:00
2016-08-07 10:13:14 -04:00
2016-08-09 10:14:10 -07:00
2016-05-05 09:54:45 -05:00
2016-07-29 15:54:19 -07:00
2016-03-16 13:09:08 -04:00
2016-07-15 10:30:26 +02:00
2016-05-26 00:13:25 -04:00
2016-05-19 19:12:14 -07:00
2016-04-14 12:56:09 -07:00
2016-05-11 00:00:29 -04:00
2016-01-16 11:17:23 -08:00
2016-07-29 15:54:19 -07:00
2016-04-04 10:41:08 -07:00
2016-06-09 23:42:38 +02:00
2016-07-26 16:19:19 -07:00
2016-08-07 10:03:31 -04:00
2016-07-05 15:06:46 -05:00