]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ocfs2: strict bound check before memcmp in ocfs2_xattr_find_entry()
authorFerry Meng <mengferry@linux.alibaba.com>
Mon, 20 May 2024 02:40:24 +0000 (10:40 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Oct 2024 13:10:40 +0000 (15:10 +0200)
commitc031d286eceb82f72f8623b7f4abd2aa491bfb5e
treeead884ea1b9283d05ebdc03d0ecc6724752de2fd
parent5bbe51eaf01a5dd6fb3f0dea81791e5dbc6dc6dd
ocfs2: strict bound check before memcmp in ocfs2_xattr_find_entry()

[ Upstream commit af77c4fc1871847b528d58b7fdafb4aa1f6a9262 ]

xattr in ocfs2 maybe 'non-indexed', which saved with additional space
requested.  It's better to check if the memory is out of bound before
memcmp, although this possibility mainly comes from crafted poisonous
images.

Link: https://lkml.kernel.org/r/20240520024024.1976129-2-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: Changwei Ge <gechangwei@live.cn>
Cc: Gang He <ghe@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Jun Piao <piaojun@huawei.com>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Mark Fasheh <mark@fasheh.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ocfs2/xattr.c