Eric Dumazet
41d4df6ff1
quota: clear padding in v2r1_mem2diskdqb()
[ Upstream commit 3d3dc274ce736227e3197868ff749cff2f175f63 ]
Freshly allocated memory contains garbage, better make sure
to init all struct v2r1_disk_dqblk fields to avoid KMSAN report:
BUG: KMSAN: uninit-value in qtree_entry_unused+0x137/0x1b0 fs/quota/quota_tree.c:218
CPU: 0 PID: 23373 Comm: syz-executor.1 Not tainted 5.9.0-rc4-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x21c/0x280 lib/dump_stack.c:118
kmsan_report+0xf7/0x1e0 mm/kmsan/kmsan_report.c:122
__msan_warning+0x58/0xa0 mm/kmsan/kmsan_instr.c:219
qtree_entry_unused+0x137/0x1b0 fs/quota/quota_tree.c:218
v2r1_mem2diskdqb+0x43d/0x710 fs/quota/quota_v2.c:285
qtree_write_dquot+0x226/0x870 fs/quota/quota_tree.c:394
v2_write_dquot+0x1ad/0x280 fs/quota/quota_v2.c:333
dquot_commit+0x4af/0x600 fs/quota/dquot.c:482
ext4_write_dquot fs/ext4/super.c:5934 [inline]
ext4_mark_dquot_dirty+0x4d8/0x6a0 fs/ext4/super.c:5985
mark_dquot_dirty fs/quota/dquot.c:347 [inline]
mark_all_dquot_dirty fs/quota/dquot.c:385 [inline]
dquot_alloc_inode+0xc05/0x12b0 fs/quota/dquot.c:1755
__ext4_new_inode+0x8204/0x9d70 fs/ext4/ialloc.c:1155
ext4_tmpfile+0x41a/0x850 fs/ext4/namei.c:2686
vfs_tmpfile+0x2a2/0x570 fs/namei.c:3283
do_tmpfile fs/namei.c:3316 [inline]
path_openat+0x4035/0x6a90 fs/namei.c:3359
do_filp_open+0x2b8/0x710 fs/namei.c:3395
do_sys_openat2+0xa88/0x1140 fs/open.c:1168
do_sys_open fs/open.c:1184 [inline]
__do_compat_sys_openat fs/open.c:1242 [inline]
__se_compat_sys_openat+0x2a4/0x310 fs/open.c:1240
__ia32_compat_sys_openat+0x56/0x70 fs/open.c:1240
do_syscall_32_irqs_on arch/x86/entry/common.c:80 [inline]
__do_fast_syscall_32+0x129/0x180 arch/x86/entry/common.c:139
do_fast_syscall_32+0x6a/0xc0 arch/x86/entry/common.c:162
do_SYSENTER_32+0x73/0x90 arch/x86/entry/common.c:205
entry_SYSENTER_compat_after_hwframe+0x4d/0x5c
RIP: 0023:0xf7ff4549
Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 eb 0d 90 90 90 90 90 90 90 90 90 90 90 90
RSP: 002b:00000000f55cd0cc EFLAGS: 00000296 ORIG_RAX: 0000000000000127
RAX: ffffffffffffffda RBX: 00000000ffffff9c RCX: 0000000020000000
RDX: 0000000000410481 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
Uninit was created at:
kmsan_save_stack_with_flags mm/kmsan/kmsan.c:143 [inline]
kmsan_internal_poison_shadow+0x66/0xd0 mm/kmsan/kmsan.c:126
kmsan_slab_alloc+0x8a/0xe0 mm/kmsan/kmsan_hooks.c:80
slab_alloc_node mm/slub.c:2907 [inline]
slab_alloc mm/slub.c:2916 [inline]
__kmalloc+0x2bb/0x4b0 mm/slub.c:3982
kmalloc include/linux/slab.h:559 [inline]
getdqbuf+0x56/0x150 fs/quota/quota_tree.c:52
qtree_write_dquot+0xf2/0x870 fs/quota/quota_tree.c:378
v2_write_dquot+0x1ad/0x280 fs/quota/quota_v2.c:333
dquot_commit+0x4af/0x600 fs/quota/dquot.c:482
ext4_write_dquot fs/ext4/super.c:5934 [inline]
ext4_mark_dquot_dirty+0x4d8/0x6a0 fs/ext4/super.c:5985
mark_dquot_dirty fs/quota/dquot.c:347 [inline]
mark_all_dquot_dirty fs/quota/dquot.c:385 [inline]
dquot_alloc_inode+0xc05/0x12b0 fs/quota/dquot.c:1755
__ext4_new_inode+0x8204/0x9d70 fs/ext4/ialloc.c:1155
ext4_tmpfile+0x41a/0x850 fs/ext4/namei.c:2686
vfs_tmpfile+0x2a2/0x570 fs/namei.c:3283
do_tmpfile fs/namei.c:3316 [inline]
path_openat+0x4035/0x6a90 fs/namei.c:3359
do_filp_open+0x2b8/0x710 fs/namei.c:3395
do_sys_openat2+0xa88/0x1140 fs/open.c:1168
do_sys_open fs/open.c:1184 [inline]
__do_compat_sys_openat fs/open.c:1242 [inline]
__se_compat_sys_openat+0x2a4/0x310 fs/open.c:1240
__ia32_compat_sys_openat+0x56/0x70 fs/open.c:1240
do_syscall_32_irqs_on arch/x86/entry/common.c:80 [inline]
__do_fast_syscall_32+0x129/0x180 arch/x86/entry/common.c:139
do_fast_syscall_32+0x6a/0xc0 arch/x86/entry/common.c:162
do_SYSENTER_32+0x73/0x90 arch/x86/entry/common.c:205
entry_SYSENTER_compat_after_hwframe+0x4d/0x5c
Fixes: 498c60153e ("quota: Implement quota format with 64-bit space and inode limits")
Link: https://lore.kernel.org/r/20200924183619.4176790-1-edumazet@google.com
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Jan Kara <jack@suse.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-10-29 09:03:04 +01:00
..
2020-08-21 10:53:04 +02:00
2019-08-06 18:28:26 +02:00
2020-09-12 11:45:32 +02:00
2017-12-20 10:04:56 +01:00
2019-12-21 10:34:21 +01:00
2018-12-01 09:46:33 +01:00
2020-09-23 08:44:25 +02:00
2020-06-03 08:12:10 +02:00
2020-10-01 11:11:56 +02:00
2020-10-29 09:03:01 +01:00
2019-08-06 18:28:27 +02:00
2019-11-12 19:13:24 +01:00
2018-11-21 09:27:37 +01:00
2019-05-16 19:45:01 +02:00
2016-08-16 09:30:49 +02:00
2020-08-21 10:53:02 +02:00
2020-03-11 07:51:14 +01:00
2016-03-03 15:07:09 -08:00
2018-11-27 16:08:00 +01:00
2020-01-29 10:21:36 +01:00
2020-08-21 10:53:05 +02:00
2020-08-26 10:27:09 +02:00
2020-08-21 10:52:53 +02:00
2020-06-20 10:23:19 +02:00
2018-12-17 21:55:11 +01:00
2020-10-01 11:11:55 +02:00
2020-06-29 20:07:53 -04:00
2019-11-28 18:25:57 +01:00
2020-04-24 07:57:16 +02:00
2016-09-30 10:18:39 +02:00
2016-06-01 12:15:54 -07:00
2019-06-11 12:23:52 +02:00
2017-11-30 08:37:20 +00:00
2020-09-03 11:19:25 +02:00
2020-08-26 10:27:09 +02:00
2020-01-29 10:21:41 +01:00
2019-11-25 15:53:59 +01:00
2018-11-21 09:27:36 +01:00
2015-11-06 17:50:42 -08:00
2020-08-21 10:53:04 +02:00
2019-03-23 08:44:21 +01:00
2020-10-14 09:46:20 +02:00
2018-02-03 17:04:28 +01:00
2020-06-29 20:07:49 -04:00
2020-06-20 10:23:16 +02:00
2018-04-24 09:32:11 +02:00
2015-11-06 17:50:42 -08:00
2020-08-21 10:53:06 +02:00
2020-06-20 10:23:17 +02:00
2020-06-20 10:23:18 +02:00
2020-01-12 11:22:46 +01:00
2020-10-29 09:03:04 +01:00
2015-10-16 11:42:28 -07:00
2020-10-17 11:03:31 +02:00
2020-08-26 10:27:08 +02:00
2018-08-06 16:24:42 +02:00
2018-09-05 09:18:40 +02:00
2018-12-17 21:55:09 +01:00
2015-11-04 22:13:45 -05:00
2020-10-01 11:11:54 +02:00
2019-07-21 09:07:08 +02:00
2020-08-21 10:53:07 +02:00
2020-10-01 11:11:51 +02:00
2018-12-21 14:09:50 +01:00
2016-10-22 12:26:56 +02:00
2015-11-10 12:07:22 -08:00
2020-06-03 08:12:11 +02:00
2019-07-10 09:56:30 +02:00
2018-07-03 11:21:26 +02:00
2019-11-06 12:09:12 +01:00
2020-10-01 11:11:54 +02:00
2019-04-27 09:33:49 +02:00
2020-05-20 08:11:40 +02:00
2018-02-25 11:03:51 +01:00
2019-08-11 12:20:46 +02:00
2017-07-05 14:37:20 +02:00
2015-11-16 23:54:45 -08:00
2019-11-10 11:21:39 +01:00
2017-10-18 09:20:42 +02:00
2019-03-23 08:44:26 +01:00
2020-10-14 09:46:21 +02:00
2020-05-20 08:11:54 +02:00
2018-01-31 12:06:11 +01:00
2016-04-12 09:08:58 -07:00
2020-05-27 16:40:23 +02:00
2020-09-03 11:19:27 +02:00
2020-04-02 19:02:31 +02:00
2015-11-16 23:54:45 -08:00
2020-04-02 19:02:38 +02:00
2020-01-12 11:22:41 +01:00
2015-10-15 10:33:21 -04:00
2017-07-21 07:44:57 +02:00
2017-06-14 13:16:24 +02:00
2020-03-11 07:51:14 +01:00
2020-05-02 17:20:40 +02:00
2018-02-16 20:09:43 +01:00
2019-08-04 09:35:01 +02:00
2020-03-11 07:51:15 +01:00
2020-05-02 17:20:55 +02:00
2017-04-30 05:49:28 +02:00
2017-01-26 08:23:47 +01:00
2016-04-12 09:08:55 -07:00
2019-06-11 12:24:13 +02:00
2020-01-04 13:34:37 +01:00
2018-01-31 12:06:09 +01:00
2017-08-06 19:19:42 -07:00
2020-03-11 07:51:15 +01:00
2017-06-14 13:16:24 +02:00
2019-02-06 19:43:08 +01:00
2015-11-06 17:50:42 -08:00
2017-05-08 07:46:01 +02:00
2019-09-06 10:18:09 +02:00
2016-10-22 12:26:56 +02:00
2020-08-21 10:52:52 +02:00