[Android 5.15] KASAN: use-after-free Read in unaccount_page_cache_page (2)

1 view
Skip to first unread message

syzbot

unread,
Jul 21, 2026, 11:33:29 AM (2 days ago) Jul 21
to syzkaller-a...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 61d896ee2a80 Revert "hdlc_ppp: sync per-proto timers befor..
git tree: android13-5.15-lts
console output: https://syzkaller.appspot.com/x/log.txt?x=11cbfc32580000
kernel config: https://syzkaller.appspot.com/x/.config?x=43676e801f1929a9
dashboard link: https://syzkaller.appspot.com/bug?extid=96d1e75bbee075e201e1
compiler: Debian clang version 22.1.8 (++20260613092233+e80beda6e255-1~exp1~20260613092250.77), Debian LLD 22.1.8
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=17de92b9580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=14f94ab9580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/bcb85cf50754/disk-61d896ee.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/7e4ac22ab0e5/vmlinux-61d896ee.xz
kernel image: https://storage.googleapis.com/syzbot-assets/14b47a248e31/bzImage-61d896ee.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/b418b5ff3902/mount_0.gz
fsck result: failed (log: https://syzkaller.appspot.com/x/fsck.log?x=10d7e746580000)

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+96d1e7...@syzkaller.appspotmail.com

F2FS-fs (loop2): Mounted with checkpoint version = 48b305e4
==================================================================
BUG: KASAN: use-after-free in cleancache_fs_enabled_mapping include/linux/cleancache.h:56 [inline]
BUG: KASAN: use-after-free in cleancache_invalidate_page include/linux/cleancache.h:110 [inline]
BUG: KASAN: use-after-free in unaccount_page_cache_page+0x6f1/0x760 mm/filemap.c:172
Read of size 4 at addr ffff88811a6f8470 by task syz.2.41/500

CPU: 0 PID: 500 Comm: syz.2.41 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/25/2026
Call Trace:
<TASK>
__dump_stack+0x21/0x30 lib/dump_stack.c:88
dump_stack_lvl+0x110/0x170 lib/dump_stack.c:106
print_address_description+0x7f/0x2c0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:427 [inline]
kasan_report+0x10f/0x150 mm/kasan/report.c:444
__asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:308
cleancache_fs_enabled_mapping include/linux/cleancache.h:56 [inline]
cleancache_invalidate_page include/linux/cleancache.h:110 [inline]
unaccount_page_cache_page+0x6f1/0x760 mm/filemap.c:172
__delete_from_page_cache+0xbe/0x470 mm/filemap.c:240
__remove_mapping+0x601/0x990 mm/vmscan.c:1216
shrink_page_list+0x2a24/0x5800 mm/vmscan.c:1829
shrink_inactive_list mm/vmscan.c:2338 [inline]
shrink_list mm/vmscan.c:2583 [inline]
shrink_lruvec+0x1297/0x3a40 mm/vmscan.c:5800
shrink_node_memcgs mm/vmscan.c:5992 [inline]
shrink_node+0x11ee/0x2a40 mm/vmscan.c:6022
shrink_zones mm/vmscan.c:6228 [inline]
do_try_to_free_pages+0x5a7/0x1580 mm/vmscan.c:6286
try_to_free_mem_cgroup_pages+0x261/0x610 mm/vmscan.c:6600
try_charge_memcg+0x3eb/0x14e0 mm/memcontrol.c:2713
try_charge mm/memcontrol.c:2838 [inline]
charge_memcg+0x6d/0x1a0 mm/memcontrol.c:6861
__mem_cgroup_charge+0x93/0x280 mm/memcontrol.c:6898
mem_cgroup_charge include/linux/memcontrol.h:715 [inline]
__add_to_page_cache_locked+0x1dd/0x880 mm/filemap.c:902
add_to_page_cache_lru+0xa7/0x210 mm/filemap.c:994
page_cache_ra_unbounded+0x466/0x960 mm/readahead.c:233
do_page_cache_ra mm/readahead.c:280 [inline]
ondemand_readahead+0x8b7/0xeb0 mm/readahead.c:565
page_cache_sync_ra+0x544/0x5a0 mm/readahead.c:597
page_cache_sync_readahead include/linux/pagemap.h:831 [inline]
f2fs_readdir+0x495/0x9e0 fs/f2fs/dir.c:1165
iterate_dir+0x25c/0x600 fs/readdir.c:-1
__do_sys_getdents fs/readdir.c:286 [inline]
__se_sys_getdents+0xf2/0x250 fs/readdir.c:271
__x64_sys_getdents+0x7b/0x90 fs/readdir.c:271
x64_sys_call+0xb4/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:79
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f2bd0751e99
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffe25ba4cc8 EFLAGS: 00000246 ORIG_RAX: 000000000000004e
RAX: ffffffffffffffda RBX: 00007f2bd09d9fa0 RCX: 00007f2bd0751e99
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000004
RBP: 00007f2bd07e7eaf R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f2bd09d9fac R14: 00007f2bd09d9fa0 R15: 00007f2bd09d9fa0
</TASK>

Allocated by task 491:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track mm/kasan/common.c:45 [inline]
set_alloc_info mm/kasan/common.c:433 [inline]
____kasan_kmalloc mm/kasan/common.c:512 [inline]
__kasan_kmalloc+0xd4/0x100 mm/kasan/common.c:521
kasan_kmalloc include/linux/kasan.h:227 [inline]
kmem_cache_alloc_trace+0x119/0x270 mm/slub.c:3274
kmalloc include/linux/slab.h:619 [inline]
kzalloc include/linux/slab.h:750 [inline]
alloc_super+0x5e/0x840 fs/super.c:203
sget+0x1e2/0x4c0 fs/super.c:637
mount_bdev+0xec/0x3c0 fs/super.c:1373
f2fs_mount+0x34/0x40 fs/f2fs/super.c:4713
legacy_get_tree+0xed/0x190 fs/fs_context.c:611
vfs_get_tree+0x89/0x260 fs/super.c:1530
do_new_mount+0x251/0xb40 fs/namespace.c:3037
path_mount+0x640/0xff0 fs/namespace.c:3367
do_mount fs/namespace.c:3380 [inline]
__do_sys_mount fs/namespace.c:3588 [inline]
__se_sys_mount+0x320/0x390 fs/namespace.c:3565
__x64_sys_mount+0xbf/0xd0 fs/namespace.c:3565
x64_sys_call+0x6bf/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:166
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0

Freed by task 365:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track+0x4a/0x70 mm/kasan/common.c:45
kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370
____kasan_slab_free+0x125/0x160 mm/kasan/common.c:365
__kasan_slab_free+0x11/0x20 mm/kasan/common.c:373
kasan_slab_free include/linux/kasan.h:193 [inline]
slab_free_hook mm/slub.c:1728 [inline]
slab_free_freelist_hook+0xc2/0x190 mm/slub.c:1754
slab_free mm/slub.c:3526 [inline]
kfree+0xc4/0x270 mm/slub.c:4588
destroy_super_work+0x40/0x50 fs/super.c:165
process_one_work+0x6c8/0xbb0 kernel/workqueue.c:2328
worker_thread+0xaa0/0x1250 kernel/workqueue.c:2475
kthread+0x3f5/0x4f0 kernel/kthread.c:337
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287

Last potentially related work creation:
kasan_save_stack+0x3a/0x60 mm/kasan/common.c:38
__kasan_record_aux_stack+0xd2/0x100 mm/kasan/generic.c:348
kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:358
insert_work+0x51/0x310 kernel/workqueue.c:1373
__queue_work+0x8e1/0xc60 kernel/workqueue.c:1539
queue_work_on+0xde/0x150 kernel/workqueue.c:1566
queue_work include/linux/workqueue.h:510 [inline]
schedule_work include/linux/workqueue.h:571 [inline]
destroy_super_rcu+0xd1/0xe0 fs/super.c:172
rcu_do_batch+0x4c1/0xbf0 kernel/rcu/tree.c:2523
rcu_core+0x4a3/0xef0 kernel/rcu/tree.c:2763
rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2776
handle_softirqs+0x250/0x560 kernel/softirq.c:583
run_ksoftirqd+0x28/0x40 kernel/softirq.c:959
smpboot_thread_fn+0x446/0x880 kernel/smpboot.c:164
kthread+0x3f5/0x4f0 kernel/kthread.c:337
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287

Second to last potentially related work creation:
kasan_save_stack+0x3a/0x60 mm/kasan/common.c:38
__kasan_record_aux_stack+0xd2/0x100 mm/kasan/generic.c:348
kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:358
__call_rcu_common kernel/rcu/tree.c:3011 [inline]
call_rcu+0x10b/0xf60 kernel/rcu/tree.c:3129
__put_super+0x26b/0x2d0 fs/super.c:299
put_super fs/super.c:313 [inline]
deactivate_locked_super+0xd4/0x100 fs/super.c:346
mount_bdev+0x2ab/0x3c0 fs/super.c:1402
f2fs_mount+0x34/0x40 fs/f2fs/super.c:4713
legacy_get_tree+0xed/0x190 fs/fs_context.c:611
vfs_get_tree+0x89/0x260 fs/super.c:1530
do_new_mount+0x251/0xb40 fs/namespace.c:3037
path_mount+0x640/0xff0 fs/namespace.c:3367
do_mount fs/namespace.c:3380 [inline]
__do_sys_mount fs/namespace.c:3588 [inline]
__se_sys_mount+0x320/0x390 fs/namespace.c:3565
__x64_sys_mount+0xbf/0xd0 fs/namespace.c:3565
x64_sys_call+0x6bf/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:166
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0

The buggy address belongs to the object at ffff88811a6f8000
which belongs to the cache kmalloc-2k of size 2048
The buggy address is located 1136 bytes inside of
2048-byte region [ffff88811a6f8000, ffff88811a6f8800)
The buggy address belongs to the page:
page:ffffea000469be00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11a6f8
head:ffffea000469be00 order:3 compound_mapcount:0 compound_pincount:0
flags: 0x4000000000010200(slab|head|zone=1)
raw: 4000000000010200 dead000000000100 dead000000000122 ffff888100043200
raw: 0000000000000000 0000000080080008 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 141, ts 7038970967, free_ts 0
set_page_owner include/linux/page_owner.h:33 [inline]
post_alloc_hook+0x192/0x1b0 mm/page_alloc.c:2607
prep_new_page+0x1c/0x110 mm/page_alloc.c:2613
get_page_from_freelist+0x2c3a/0x2cd0 mm/page_alloc.c:4487
__alloc_pages+0x1a2/0x460 mm/page_alloc.c:5824
alloc_slab_page mm/slub.c:-1 [inline]
allocate_slab mm/slub.c:1937 [inline]
new_slab+0xa0/0x4d0 mm/slub.c:2000
___slab_alloc+0x3ac/0x840 mm/slub.c:3033
__slab_alloc+0x49/0x90 mm/slub.c:3120
slab_alloc_node mm/slub.c:3211 [inline]
slab_alloc mm/slub.c:3255 [inline]
__kmalloc_track_caller+0x169/0x2c0 mm/slub.c:4954
kmemdup+0x26/0x60 mm/util.c:132
bpf_migrate_filter net/core/filter.c:1269 [inline]
bpf_prepare_filter+0xc33/0x11b0 net/core/filter.c:1355
bpf_prog_create_from_user+0x2c5/0x420 net/core/filter.c:1449
seccomp_prepare_filter kernel/seccomp.c:669 [inline]
seccomp_prepare_user_filter kernel/seccomp.c:706 [inline]
seccomp_set_mode_filter kernel/seccomp.c:1834 [inline]
do_seccomp+0x803/0x1480 kernel/seccomp.c:1954
prctl_set_seccomp+0x4c/0x60 kernel/seccomp.c:2007
__do_sys_prctl kernel/sys.c:2447 [inline]
__se_sys_prctl+0x543/0x1210 kernel/sys.c:2365
__x64_sys_prctl+0xbf/0xd0 kernel/sys.c:2365
x64_sys_call+0x633/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:158
page_owner free stack trace missing

Memory state around the buggy address:
ffff88811a6f8300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88811a6f8380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88811a6f8400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88811a6f8480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88811a6f8500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup
Reply all
Reply to author
Forward
0 new messages