From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oo1-f72.google.com (mail-oo1-f72.google.com [209.85.161.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E120635F607 for ; Fri, 17 Apr 2026 10:12:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.72 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776420748; cv=none; b=M3yFlbWQ9bbWderQ3jybF9LDu7m9Zz+NezE767bWdynxxsW89+exKpVro4eACnHI61psLdlRj9cnGLg6bW/hoUiohR1/z6ABusPndobdsOzcPBQzqcKRjQZf7HCvssMWDohF46kvi63bjC1E/QE/52NyOgyqhnHkC4wktiYxTs8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776420748; c=relaxed/simple; bh=AL79OpkqKOYn3ejbVHIhoPN04zXtHjmrp0gH3TaUJCY=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=NAA0aACew3CaI3lZn3Mh12EXx3o1T6LVafRQWwT07mFJgosKtUSNLkEzgG/BEvn6fOa8r3f/nWIDMPi6hDQJUl/a7HAbtYcTjkS//oOXLX+R14uru2P9c7iq80b3qj7uoekOpcvYrZKrxlW6SD6GN/rL5xHGQcMerfV6VcI6qeA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.161.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-oo1-f72.google.com with SMTP id 006d021491bc7-679c5ed0942so741780eaf.1 for ; Fri, 17 Apr 2026 03:12:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776420746; x=1777025546; h=to:from:subject:message-id:in-reply-to:date:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ePDmCU4C3+GzzR9O43gpAEEHAZmfIv9CROd9uU5F7mM=; b=TlGQF7zuBzL8gTlAR4OsXdkP5ZYb7vQUh7EREPu3FOtrNjEc8CwHDvOAHHAI7gYAFz n5oyzX3QHS+4MLq4YAIC4fR5wNLOLwTVnX5KBFV4e02g86akY3xWw7rxN5lv+S+KihLx /PwZI1+nlqNCkEpMc+vR1v13yfyyJnBOEqt4wvKMVnCL15U460cS60aYYFxBr96Y00aU 3/hN/idVvMG5H8CE8NAGdIjQmHV7hw/dF0Wl4Z739wy93Ax0Dl2Y5GzYlqfbn1QfC8Ik dwIn3hsmAVaSjHAsGfYnJRGvzrKyQ6Mdg0aIz7LKy0ioRu2Aj89AIB1urf9W3roSYfum QstQ== X-Gm-Message-State: AOJu0Yya+zWIv8yHx5GqAbqoBzXeP+LO6/fItFphIz/2cbZ5bubynf2o 8P5o70qWFCmpxZntgPG/AzZnnB9jQwHWQqOtrTOcelW/EcniWpuie7iCAGcSIe4IpBvtgy32Mqf FWN/SaAWrXNvzZbZTfYLqkdKzo7E0Gtg8kXGIV284Eslbp9N38N0TjCgXT8E= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a05:6820:3108:b0:68c:c971:9ef0 with SMTP id 006d021491bc7-69462dee1ecmr1080955eaf.1.1776420745878; Fri, 17 Apr 2026 03:12:25 -0700 (PDT) Date: Fri, 17 Apr 2026 03:12:25 -0700 In-Reply-To: <67ddd191.050a0220.25ae54.006a.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <69e20789.a00a0220.1cdc.000c.GAE@google.com> Subject: Forwarded: [PATCH] ocfs2: zero-initialize quota recovery bitmap allocation From: syzbot To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: [PATCH] ocfs2: zero-initialize quota recovery bitmap allocation Author: tristmd@gmail.com From: Tristan Madani #syz test: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master ocfs2_add_recovery_chunk() allocates a full block-sized buffer for the recovery bitmap with kmalloc(), but only copies the meaningful portion of the on-disk bitmap: rc->rc_bitmap = kmalloc(sb->s_blocksize, GFP_NOFS); memcpy(rc->rc_bitmap, dchunk->dqc_bitmap, (ol_chunk_entries(sb) + 7) >> 3); The remaining bytes beyond the copied region are left uninitialized. When ocfs2_recover_local_quota_file() later passes this bitmap to find_next_bit(), it reads the uninitialized tail bytes, which KMSAN flags as a use of uninitialized memory. Fix this by using kzalloc() to ensure the entire buffer is zeroed, so that find_next_bit() sees zero bits (no recovery needed) for entries beyond the valid bitmap portion. Reported-by: syzbot+7ea0b96c4ddb49fd1a70@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=7ea0b96c4ddb49fd1a70 Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Signed-off-by: Tristan Madani --- 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 XXXXXXX..XXXXXXX 100644 --- a/fs/ocfs2/quota_local.c +++ b/fs/ocfs2/quota_local.c @@ -305,7 +305,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.43.0