]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
jfs: xattr: fix buffer overflow for invalid xattr
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 May 2024 10:06:34 +0000 (12:06 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 4 Jun 2024 16:09:03 +0000 (18:09 +0200)
commit7c55b78818cfb732680c4a72ab270cc2d2ee3d0f
tree62c34b4f558ab0e97f9aaba704dd17ddb192de9f
parent77427e3d5c353e3dd98c7c0af322f8d9e3131ace
jfs: xattr: fix buffer overflow for invalid xattr

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: 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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/jfs/xattr.c