Forwarded: Re: [syzbot] KMSAN: uninit-value in ocfs2_recover_local_quota_file

From: syzbot

Date: Fri Apr 17 2026 - 12:25:09 EST


For archival purposes, forwarding an incoming command email to
linux-kernel@xxxxxxxxxxxxxxx, syzkaller-bugs@xxxxxxxxxxxxxxxx.

***

Subject: Re: [syzbot] KMSAN: uninit-value in ocfs2_recover_local_quota_file
Author: tristmd@xxxxxxxxx

#syz test: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
>From 1ade1b62aa44f46691057222a65eebd8ce67f470 Mon Sep 17 00:00:00 2001
From: Tristan Madani <tristan@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 17 Apr 2026 16:15:18 +0000
Subject: [PATCH] ocfs2: zero-initialize quota recovery bitmap allocation
ocfs2_add_recovery_chunk() allocates rc_bitmap with kmalloc,
leaving the bitmap uninitialized. Bits beyond the actual quota
entries contain stale heap data, which KMSAN detects as
uninit-value during recovery.
Replace kmalloc with kzalloc to ensure the bitmap is zeroed.
Reported-by: syzbot+7ea0b96c4ddb49fd1a70@xxxxxxxxxxxxxxxxxxxxxxxxx
Closes: https://syzkaller.appspot.com/bug?extid=7ea0b96c4ddb49fd1a70
Signed-off-by: Tristan Madani <tristan@xxxxxxxxxxxxxxxxxxx>
---
fs/ocfs2/quota_local.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/ocfs2/quota_local.c b/fs/ocfs2/quota_local.c
index 12cbb4f..f55810c 100644
--- a/fs/ocfs2/quota_local.c
+++ b/fs/ocfs2/quota_local.c
@@ -302,7 +302,7 @@ static int ocfs2_add_recovery_chunk(struct super_block *sb,
if (!rc)
return -ENOMEM;
rc->rc_chunk = chunk;
- rc->rc_bitmap = kmalloc(sb->s_blocksize, GFP_NOFS);
+ rc->rc_bitmap = kzalloc(sb->s_blocksize, GFP_NOFS);
if (!rc->rc_bitmap) {
kfree(rc);
return -ENOMEM;
--
2.47.3