CVE-2024-50265 Information
Description
In the Linux kernel the following vulnerability has been resolved:
ocfs2: remove entry once instead of null-ptr-dereference in ocfs2_xa_remove()
Syzkaller is able to provoke null-ptr-dereference in ocfs2_xa_remove():
[ 57.319872] (a.out11617):ocfs2_xa_remove:2028 ERROR: status = -12
[ 57.320420] (a.out11617):ocfs2_xa_cleanup_value_truncate:1999 ERROR: Partial truncate while removing xattr overlay.upper. Leaking 1 clusters and removing the entry
[ 57.321727] BUG: kernel NULL pointer dereference address: 0000000000000004
[…]
[ 57.325727] RIP: 0010:ocfs2_xa_block_wipe_namevalue+0x2a/0xc0
[…]
[ 57.331328] Call Trace:
[ 57.331477]
Reproducer uses faultinject facility to fail ocfs2_xa_remove() -> ocfs2_xa_value_truncate() with -ENOMEM.
In this case the comment mentions that we can return 0 if ocfs2_xa_cleanup_value_truncate() is going to wipe the entry anyway. But the following ‘rc’ check is wrong and execution flow do ‘ocfs2_xa_remove_entry(loc);’ twice: 1st: in ocfs2_xa_cleanup_value_truncate(); 2nd: returning back to ocfs2_xa_remove() instead of going to ‘out’.
Fix this by skipping the 2nd removal of the same entry and making syzkaller repro happy.
Reference
https://git.kernel.org/stable/c/38cbf13b2e7a31362babe411f7c2c3c52cd2734b https://git.kernel.org/stable/c/168a9b8303fcb0317db4c06b23ce1c0ce2af4e10 https://git.kernel.org/stable/c/6a7e6dcf90fe7721d0863067b6ca9a9442134692 https://git.kernel.org/stable/c/dcc8fe8c83145041cb6c80cac21f6173a3ff0204 https://git.kernel.org/stable/c/86dd0e8d42828923c68ad506933336bcd6f2317d https://git.kernel.org/stable/c/dd73c942eed76a014c7a5597e6926435274d2c4c https://git.kernel.org/stable/c/2b5369528ee63c88371816178a05b5e664c87386 https://git.kernel.org/stable/c/0b63c0e01fba40e3992bc627272ec7b618ccaef7
Share on: