From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BA5E14582DD; Tue, 21 Jul 2026 22:20:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784672442; cv=none; b=sallMm+/N8MgawUPdNZEon7w9Y1wIU+Er6ctJD7xlZSkqJxy6zdk1d0tlTxcK7E9K6LlvWneLsswNyBt0dejoozalK3At02iMzxbAo4lIDEpA3tYGrwivrMC9i0EyjJzcxIVdDssU88ylp+dh9Dz4tgqeVVI9TUn5sWUzcuNIbM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784672442; c=relaxed/simple; bh=L+p6OGR8hBjubsSWN9tMLtOl5zkvnokzjv0IGMX2A1I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KRC6iaFBMrZpPPwu6URt7HuI0h35dx51MpsxMv6CC2gu4HuQqX0uGfEaqMR0U146ALov1bH8aKq5G7YwYnVsTOIoabK1X46nxZem807MOWkqUzJbbBQbepdDBvexHglyGrBrjioV869zsv6sEMct//lBVZoXhgIIuVwlfhaGD+I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=GItk6yqu; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="GItk6yqu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 341D61F000E9; Tue, 21 Jul 2026 22:20:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784672441; bh=qTkgo5wFNPkLJ80cGJ8nfzMRYBaYp7UQIDnlYRlE9XE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=GItk6yqu//wL6BTTlHwAlP8Z6pDpV2n5I8ayLSUO3Alv7dxaGVPHJyeHeRgIkYpz/ Jcn84mNHo/3Rlo0N5PQ6ibcK56XQDeEYXFarD9zk5EE8iAYrVv51AqDn9q3K34OkgC GVFBGPRS5BD6BT0JA8utEcUjPC7fRz5MU9lKO9aQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, syzbot+7ea0b96c4ddb49fd1a70@syzkaller.appspotmail.com, Tristan Madani , Joseph Qi , Mark Fasheh , Joel Becker , Junxiao Bi , Changwei Ge , Jun Piao , Heming Zhao , Andrew Morton Subject: [PATCH 5.15 624/843] ocfs2: use kzalloc for quota recovery bitmap allocation Date: Tue, 21 Jul 2026 17:24:19 +0200 Message-ID: <20260721152420.097969362@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260721152405.946368001@linuxfoundation.org> References: <20260721152405.946368001@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tristan Madani commit 93c8c6ea90be9e9df8fe14048ad4e3caad0770a6 upstream. ocfs2 quota recovery allocates a bitmap buffer with kmalloc and does not fully initialize it. This can lead to use of uninitialized bits during quota recovery from a corrupted filesystem image. Use kzalloc instead to ensure the bitmap is zero-initialized. Link: https://lore.kernel.org/20260418131048.1052507-1-tristmd@gmail.com Reported-by: syzbot+7ea0b96c4ddb49fd1a70@syzkaller.appspotmail.com Signed-off-by: Tristan Madani Reviewed-by: Joseph Qi Cc: Mark Fasheh Cc: Joel Becker Cc: Junxiao Bi Cc: Changwei Ge Cc: Jun Piao Cc: Heming Zhao Cc: Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- fs/ocfs2/quota_local.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/ocfs2/quota_local.c +++ b/fs/ocfs2/quota_local.c @@ -302,7 +302,7 @@ static int ocfs2_add_recovery_chunk(stru 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;