]> www.infradead.org Git - users/willy/linux.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)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 25 Jun 2024 05:24:55 +0000 (22:24 -0700)
commitaf77c4fc1871847b528d58b7fdafb4aa1f6a9262
tree329ade1b1d4ec45fc19e41bafb5f25fd05895c6b
parent9e3041fecdc8f78a5900c3aa51d3d756e73264d6
ocfs2: strict bound check before memcmp in ocfs2_xattr_find_entry()

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>
fs/ocfs2/xattr.c