• Eric Dumazet's avatar
    quota: clear padding in v2r1_mem2diskdqb() · 3d3dc274
    Eric Dumazet authored
    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/quo...
    3d3dc274
quota_v2.c 11.8 KB