CVE-2024-44941 Information
Description
In the Linux kernel the following vulnerability has been resolved:
f2fs: fix to cover read extent cache access with lock
syzbot reports a f2fs bug as below:
BUG: KASAN: slab-use-after-free in sanity_check_extent_cache+0x370/0x410 fs/f2fs/extent_cache.c:46 Read of size 4 at addr ffff8880739ab220 by task syz-executor200/5097
CPU: 0 PID: 5097 Comm: syz-executor200 Not tainted 6.9.0-rc6-syzkaller 0
Hardware name: Google Google Compute Engine/Google Compute Engine BIOS Google 03/27/2024
Call Trace:
We missed to cover sanity_check_extent_cache() w/ extent cache lock so below race case may happen result in use after free issue.
- f2fs_iget
- do_read_inode
- f2fs_init_read_extent_tree : add largest extent entry in to cache - shrink - f2fs_shrink_read_extent_tree - __shrink_extent_tree - __detach_extent_node : drop largest extent entry
- sanity_check_extent_cache : access et->largest w/o lock
let’s refactor sanity_check_extent_cache() to avoid extent cache access and call it before f2fs_init_read_extent_tree() to fix this issue.
Reference
https://git.kernel.org/stable/c/263df78166d3a9609b97d28c34029bd01874cbb8 https://git.kernel.org/stable/c/323ef20b5558b9d9fd10c1224327af6f11a8177d https://git.kernel.org/stable/c/d7409b05a64f212735f0d33f5f1602051a886eab
Share on: