]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ocfs2: add bounds checking to ocfs2_xattr_find_entry()
authorFerry Meng <mengferry@linux.alibaba.com>
Mon, 20 May 2024 02:40:23 +0000 (10:40 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 30 Sep 2024 14:25:12 +0000 (16:25 +0200)
commit1f6e167d6753fe3ea493cdc7f7de8d03147a4d39
tree7a1f0f7d78eb2481eb2e7ce232c6861181ef7e69
parent4c21bba38b943ba072814cd792456373fae5f5e2
ocfs2: add bounds checking to ocfs2_xattr_find_entry()

[ Upstream commit 9e3041fecdc8f78a5900c3aa51d3d756e73264d6 ]

Add a paranoia check to make sure it doesn't stray beyond valid memory
region containing ocfs2 xattr entries when scanning for a match.  It will
prevent out-of-bound access in case of crafted images.

Link: https://lkml.kernel.org/r/20240520024024.1976129-1-joseph.qi@linux.alibaba.com
Signed-off-by: Ferry Meng <mengferry@linux.alibaba.com>
Signed-off-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Reported-by: lei lu <llfamsec@gmail.com>
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Gang He <ghe@suse.com>
Cc: Jun Piao <piaojun@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Stable-dep-of: af77c4fc1871 ("ocfs2: strict bound check before memcmp in ocfs2_xattr_find_entry()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ocfs2/xattr.c