Skip to content
Commit c7637ab2 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman Committed by Xia Fukun
Browse files

jfs: xattr: fix buffer overflow for invalid xattr

mainline inclusion
from mainline-v6.10-rc1
commit 7c55b78818cfb732680c4a72ab270cc2d2ee3d0f
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IAD0FK
CVE: CVE-2024-40902

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7c55b78818cfb732680c4a72ab270cc2d2ee3d0f



--------------------------------

When an xattr size is not what is expected, it is printed out to the
kernel log in hex format as a form of debugging.  But when that xattr
size is bigger than the expected size, printing it out can cause an
access off the end of the buffer.

Fix this all up by properly restricting the size of the debug hex dump
in the kernel log.

Reported-by: default avatar <syzbot+9dfe490c8176301c1d06@syzkaller.appspotmail.com>
Cc: Dave Kleikamp <shaggy@kernel.org>
Link: https://lore.kernel.org/r/2024051433-slider-cloning-98f9@gregkh


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarXia Fukun <xiafukun@huawei.com>
parent 7d9b6885
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment