]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ext4: xattr: fix null pointer deref in ext4_raw_inode()
authorKarina Yankevich <k.yankevich@omp.ru>
Wed, 22 Oct 2025 09:32:53 +0000 (12:32 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jan 2026 12:09:49 +0000 (13:09 +0100)
commit3d8d22e75f7edfa0b30ff27330fd6a1285d594c3
tree45c59674a5f809ca064eed7d8b309f174a839159
parentea4e2ad6f612d7ef32f7b7c9bd68278131c90021
ext4: xattr: fix null pointer deref in ext4_raw_inode()

commit b97cb7d6a051aa6ebd57906df0e26e9e36c26d14 upstream.

If ext4_get_inode_loc() fails (e.g. if it returns -EFSCORRUPTED),
iloc.bh will remain set to NULL. Since ext4_xattr_inode_dec_ref_all()
lacks error checking, this will lead to a null pointer dereference
in ext4_raw_inode(), called right after ext4_get_inode_loc().

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: c8e008b60492 ("ext4: ignore xattrs past end")
Cc: stable@kernel.org
Signed-off-by: Karina Yankevich <k.yankevich@omp.ru>
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Reviewed-by: Baokun Li <libaokun1@huawei.com>
Message-ID: <20251022093253.3546296-1-k.yankevich@omp.ru>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/xattr.c