From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 9D57E1AC423; Mon, 14 Oct 2024 15:16:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728918999; cv=none; b=DZNIjc7B9Nqc0MqFp73Na5huvGF/8yydt6nDk4+SLJtGQfC1gJ3dDBcWInBL+AjQdKg0GqSrGw2W61fMjC2LvwxTYnnhJPOXkR2C2x2B/90k8r052sHiVkGTOAGidoJz5HWnZ7glqoNYG7u+N1IKUV9yPa1GGraGlxlt8WTUztc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728918999; c=relaxed/simple; bh=vnjtV2kGC+EHY0G6eCovP8LtIi2YSWrGsiWVXQLi8pQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZGxlEYN+uy7OPX0CKhIXenxwBQgkuOenjP9dwYLQhZ6dyz1Nlqbbx7O/AmdbR8Jv/aWk6vwwdNYRUKT0dsxooA1XBv3fOkqEGjY5/eOSws3P7H5O3BEWamcjt2MS/XUDUVJW5FZaFZ6SRZKAstu4+31W4TXr9K0iAN+5qKSt49A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=z+qKHqNZ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="z+qKHqNZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0E41AC4CEC3; Mon, 14 Oct 2024 15:16:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1728918999; bh=vnjtV2kGC+EHY0G6eCovP8LtIi2YSWrGsiWVXQLi8pQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=z+qKHqNZ4SyTQZVuciK8gREq91eSH+4uqgJohJ7JTUUJISBm55wJWlRBkyBGlRfq1 Yn5/EJrPB3xcSeJYjba6Ore8hj9uMzy1iHBfcCX1T2KkLOtb/K2YuLizVJ+VVJLxlH wZXKYtkFxbknokW5C6vqBGDJvTh6+rSlXw/kwVSE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, syzbot+02341e0daa42a15ce130@syzkaller.appspotmail.com, Zhao Mengmeng , Dave Kleikamp , Sasha Levin Subject: [PATCH 6.1 484/798] jfs: Fix uninit-value access of new_ea in ea_buffer Date: Mon, 14 Oct 2024 16:17:18 +0200 Message-ID: <20241014141236.987811272@linuxfoundation.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241014141217.941104064@linuxfoundation.org> References: <20241014141217.941104064@linuxfoundation.org> User-Agent: quilt/0.67 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 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Zhao Mengmeng [ Upstream commit 2b59ffad47db1c46af25ccad157bb3b25147c35c ] syzbot reports that lzo1x_1_do_compress is using uninit-value: ===================================================== BUG: KMSAN: uninit-value in lzo1x_1_do_compress+0x19f9/0x2510 lib/lzo/lzo1x_compress.c:178 ... Uninit was stored to memory at: ea_put fs/jfs/xattr.c:639 [inline] ... Local variable ea_buf created at: __jfs_setxattr+0x5d/0x1ae0 fs/jfs/xattr.c:662 __jfs_xattr_set+0xe6/0x1f0 fs/jfs/xattr.c:934 ===================================================== The reason is ea_buf->new_ea is not initialized properly. Fix this by using memset to empty its content at the beginning in ea_get(). Reported-by: syzbot+02341e0daa42a15ce130@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=02341e0daa42a15ce130 Signed-off-by: Zhao Mengmeng Signed-off-by: Dave Kleikamp Signed-off-by: Sasha Levin --- fs/jfs/xattr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/jfs/xattr.c b/fs/jfs/xattr.c index 8ef8dfc3c1944..76b89718fd526 100644 --- a/fs/jfs/xattr.c +++ b/fs/jfs/xattr.c @@ -434,6 +434,8 @@ static int ea_get(struct inode *inode, struct ea_buffer *ea_buf, int min_size) int rc; int quota_allocation = 0; + memset(&ea_buf->new_ea, 0, sizeof(ea_buf->new_ea)); + /* When fsck.jfs clears a bad ea, it doesn't clear the size */ if (ji->ea.flag == 0) ea_size = 0; -- 2.43.0