==================================================================
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+0x6d8/0x750 mm/filemap.c:163
Read of size 4 at addr ffff88811489d470 by task syz-executor.5/27119
CPU: 0 PID: 27119 Comm: syz-executor.5 Not tainted 5.15.147-syzkaller-00327-g1c3a1f32bcbd #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x151/0x1b7 lib/dump_stack.c:106
print_address_description+0x87/0x3b0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:427 [inline]
kasan_report+0x179/0x1c0 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+0x6d8/0x750 mm/filemap.c:163
__delete_from_page_cache+0xc6/0x5b0 mm/filemap.c:231
__remove_mapping+0x566/0x690 mm/vmscan.c:1200
shrink_page_list+0x2723/0x5c50 mm/vmscan.c:1797
shrink_inactive_list mm/vmscan.c:2304 [inline]
shrink_list mm/vmscan.c:2549 [inline]
shrink_lruvec+0x17ec/0x4580 mm/vmscan.c:5752
shrink_node_memcgs mm/vmscan.c:5944 [inline]
shrink_node+0x1077/0x24e0 mm/vmscan.c:5974
shrink_zones mm/vmscan.c:6177 [inline]
do_try_to_free_pages+0x5b6/0x1570 mm/vmscan.c:6235
try_to_free_pages+0x3a5/0xd70 mm/vmscan.c:6470
__perform_reclaim mm/page_alloc.c:4948 [inline]
__alloc_pages_direct_reclaim mm/page_alloc.c:4971 [inline]
__alloc_pages_slowpath+0x160a/0x3860 mm/page_alloc.c:5394
__alloc_pages+0x503/0x8f0 mm/page_alloc.c:5789
__vmalloc_area_node mm/vmalloc.c:2955 [inline]
__vmalloc_node_range+0x482/0x8d0 mm/vmalloc.c:3086
__bpf_map_area_alloc kernel/bpf/syscall.c:328 [inline]
bpf_map_area_alloc+0xd9/0xf0 kernel/bpf/syscall.c:335
queue_stack_map_alloc+0xc3/0x200 kernel/bpf/queue_stack_maps.c:76
find_and_alloc_map kernel/bpf/syscall.c:129 [inline]
map_create+0x411/0x2050 kernel/bpf/syscall.c:857
__sys_bpf+0x296/0x760 kernel/bpf/syscall.c:4600
__do_sys_bpf kernel/bpf/syscall.c:4722 [inline]
__se_sys_bpf kernel/bpf/syscall.c:4720 [inline]
__x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:4720
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7f7bd0609da9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f7bcf38c0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 00007f7bd0738f80 RCX: 00007f7bd0609da9
RDX: 0000000000000048 RSI: 0000000020000140 RDI: 0000000000000000
RBP: 00007f7bd065647a R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f7bd0738f80 R15: 00007ffe4f1772f8
Allocated by task 410:
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+0xdb/0x110 mm/kasan/common.c:512
__kasan_kmalloc+0x9/0x10 mm/kasan/common.c:521
kasan_kmalloc include/linux/kasan.h:227 [inline]
__kmalloc+0x13a/0x270 mm/slub.c:4427
__kmalloc_node include/linux/slab.h:469 [inline]
kmalloc_node include/linux/slab.h:626 [inline]
kvmalloc_node+0x1f0/0x4d0 mm/util.c:628
kvmalloc include/linux/mm.h:851 [inline]
xt_alloc_table_info+0x42/0xb0 net/netfilter/x_tables.c:1192
do_replace net/ipv6/netfilter/ip6_tables.c:1141 [inline]
do_ip6t_set_ctl+0xacc/0x3f50 net/ipv6/netfilter/ip6_tables.c:1638
nf_setsockopt+0x274/0x2a0 net/netfilter/nf_sockopt.c:101
ipv6_setsockopt+0x2a07/0x4240 net/ipv6/ipv6_sockglue.c:1011
tcp_setsockopt+0x22d/0x3800 net/ipv4/tcp.c:3688
sock_common_setsockopt+0xa2/0xc0 net/core/sock.c:3448
__sys_setsockopt+0x4dc/0x840 net/socket.c:2198
__do_sys_setsockopt net/socket.c:2209 [inline]
__se_sys_setsockopt net/socket.c:2206 [inline]
__x64_sys_setsockopt+0xbf/0xd0 net/socket.c:2206
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x61/0xcb
Freed by task 410:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:45
kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370
____kasan_slab_free+0x126/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:1723 [inline]
slab_free_freelist_hook+0xbd/0x190 mm/slub.c:1749
slab_free mm/slub.c:3519 [inline]
kfree+0xc8/0x220 mm/slub.c:4579
kvfree+0x35/0x40 mm/util.c:664
xt_free_table_info+0x15e/0x1a0 net/netfilter/x_tables.c:1212
__do_replace+0x81a/0xad0 net/ipv6/netfilter/ip6_tables.c:1103
do_replace net/ipv6/netfilter/ip6_tables.c:1156 [inline]
do_ip6t_set_ctl+0x2da2/0x3f50 net/ipv6/netfilter/ip6_tables.c:1638
nf_setsockopt+0x274/0x2a0 net/netfilter/nf_sockopt.c:101
ipv6_setsockopt+0x2a07/0x4240 net/ipv6/ipv6_sockglue.c:1011
tcp_setsockopt+0x22d/0x3800 net/ipv4/tcp.c:3688
sock_common_setsockopt+0xa2/0xc0 net/core/sock.c:3448
__sys_setsockopt+0x4dc/0x840 net/socket.c:2198
__do_sys_setsockopt net/socket.c:2209 [inline]
__se_sys_setsockopt net/socket.c:2206 [inline]
__x64_sys_setsockopt+0xbf/0xd0 net/socket.c:2206
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x61/0xcb
Last potentially related work creation:
kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38
__kasan_record_aux_stack+0xd3/0xf0 mm/kasan/generic.c:348
kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:358
__call_rcu kernel/rcu/tree.c:3007 [inline]
call_rcu+0x133/0x12a0 kernel/rcu/tree.c:3087
netlink_release+0x12df/0x16f0 net/netlink/af_netlink.c:819
__sock_release net/socket.c:649 [inline]
sock_close+0xdf/0x270 net/socket.c:1336
__fput+0x3fe/0x910 fs/file_table.c:280
____fput+0x15/0x20 fs/file_table.c:308
task_work_run+0x129/0x190 kernel/task_work.c:164
tracehook_notify_resume include/linux/tracehook.h:189 [inline]
exit_to_user_mode_loop+0xc4/0xe0 kernel/entry/common.c:175
exit_to_user_mode_prepare+0x5a/0xa0 kernel/entry/common.c:208
__syscall_exit_to_user_mode_work kernel/entry/common.c:290 [inline]
syscall_exit_to_user_mode+0x26/0x160 kernel/entry/common.c:301
do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x61/0xcb
Second to last potentially related work creation:
kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38
__kasan_record_aux_stack+0xd3/0xf0 mm/kasan/generic.c:348
kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:358
insert_work+0x56/0x320 kernel/workqueue.c:1373
__queue_work+0x92a/0xcd0 kernel/workqueue.c:1539
queue_work_on+0x105/0x170 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+0x57a/0xc10 kernel/rcu/tree.c:2523
rcu_core+0x517/0x1020 kernel/rcu/tree.c:2763
rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2776
__do_softirq+0x26d/0x5bf kernel/softirq.c:565
The buggy address belongs to the object at ffff88811489d000
which belongs to the cache kmalloc-2k of size 2048
The buggy address is located 1136 bytes inside of
2048-byte region [ffff88811489d000, ffff88811489d800)
The buggy address belongs to the page:
page:ffffea0004522600 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x114898
head:ffffea0004522600 order:3 compound_mapcount:0 compound_pincount:0
flags: 0x4000000000010200(slab|head|zone=1)
raw: 4000000000010200 dead000000000100 dead000000000122 ffff888100043200
raw: 0000000000000000 0000000000080008 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 0x1d2a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 8819, ts 264292376116, free_ts 264255390147
set_page_owner include/linux/page_owner.h:33 [inline]
post_alloc_hook+0x1a3/0x1b0 mm/page_alloc.c:2604
prep_new_page+0x1b/0x110 mm/page_alloc.c:2610
get_page_from_freelist+0x3550/0x35d0 mm/page_alloc.c:4484
__alloc_pages+0x27e/0x8f0 mm/page_alloc.c:5776
allocate_slab mm/slub.c:1932 [inline]
new_slab+0x9a/0x4e0 mm/slub.c:1995
___slab_alloc+0x39e/0x830 mm/slub.c:3028
__slab_alloc+0x4a/0x90 mm/slub.c:3115
slab_alloc_node mm/slub.c:3206 [inline]
slab_alloc mm/slub.c:3248 [inline]
__kmalloc_track_caller+0x16c/0x260 mm/slub.c:4945
kmalloc_reserve net/core/skbuff.c:357 [inline]
pskb_expand_head+0x113/0x1240 net/core/skbuff.c:1727
netlink_trim+0x19b/0x230 net/netlink/af_netlink.c:1312
netlink_broadcast_filtered+0x66/0x1220 net/netlink/af_netlink.c:1517
netlink_broadcast net/netlink/af_netlink.c:1562 [inline]
nlmsg_multicast include/net/netlink.h:1033 [inline]
nlmsg_notify+0x101/0x1c0 net/netlink/af_netlink.c:2548
rtnl_notify net/core/rtnetlink.c:730 [inline]
rtmsg_ifinfo_send net/core/rtnetlink.c:3887 [inline]
rtmsg_ifinfo_event net/core/rtnetlink.c:3902 [inline]
rtmsg_ifinfo+0xe7/0x120 net/core/rtnetlink.c:3908
__dev_notify_flags+0xdd/0x610 net/core/dev.c:8851
__rtnl_newlink net/core/rtnetlink.c:3509 [inline]
rtnl_newlink+0x19d1/0x2050 net/core/rtnetlink.c:3549
rtnetlink_rcv_msg+0x951/0xc40 net/core/rtnetlink.c:5630
page last free stack trace:
reset_page_owner include/linux/page_owner.h:26 [inline]
free_pages_prepare mm/page_alloc.c:1471 [inline]
free_pcp_prepare mm/page_alloc.c:1543 [inline]
free_unref_page_prepare+0x7c8/0x7d0 mm/page_alloc.c:3533
free_unref_page+0xe8/0x750 mm/page_alloc.c:3615
free_the_page mm/page_alloc.c:804 [inline]
__free_pages+0x61/0xf0 mm/page_alloc.c:5852
__free_slab+0xec/0x1d0 mm/slub.c:2020
free_slab mm/slub.c:2035 [inline]
discard_slab mm/slub.c:2041 [inline]
__unfreeze_partials+0x165/0x1a0 mm/slub.c:2527
put_cpu_partial+0xc4/0x120 mm/slub.c:2607
__slab_free+0x1c8/0x290 mm/slub.c:3388
do_slab_free mm/slub.c:3507 [inline]
___cache_free+0x109/0x120 mm/slub.c:3526
qlink_free+0x4d/0x90 mm/kasan/quarantine.c:157
qlist_free_all+0x44/0xb0 mm/kasan/quarantine.c:176
kasan_quarantine_reduce+0x15a/0x180 mm/kasan/quarantine.c:283
__kasan_slab_alloc+0x2f/0xe0 mm/kasan/common.c:443
kasan_slab_alloc include/linux/kasan.h:217 [inline]
slab_post_alloc_hook+0x53/0x2c0 mm/slab.h:550
slab_alloc_node mm/slub.c:3240 [inline]
slab_alloc mm/slub.c:3248 [inline]
kmem_cache_alloc+0xf5/0x200 mm/slub.c:3253
sock_alloc_inode+0x1b/0xb0 net/socket.c:303
alloc_inode fs/inode.c:236 [inline]
new_inode_pseudo+0x64/0x220 fs/inode.c:937
Memory state around the buggy address:
ffff88811489d300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88811489d380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88811489d400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88811489d480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88811489d500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
general protection fault, probably for non-canonical address 0xdffffc00000000e3: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000718-0x000000000000071f]
CPU: 0 PID: 27119 Comm: syz-executor.5 Tainted: G B 5.15.147-syzkaller-00327-g1c3a1f32bcbd #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
RIP: 0010:f2fs_release_page+0x23a/0x7c0 fs/f2fs/data.c:3698
Code: 00 4c 03 23 4c 89 e0 48 c1 e8 03 42 80 3c 30 00 74 08 4c 89 e7 e8 86 7f 8b ff bb 18 07 00 00 49 03 1c 24 48 89 d8 48 c1 e8 03 <42> 0f b6 04 30 84 c0 0f 85 3c 05 00 00 44 8b 23 bb 00 00 00 40 be
RSP: 0000:ffffc90000b06908 EFLAGS: 00010202
RAX: 00000000000000e3 RBX: 0000000000000718 RCX: ffffffff8226881a
RDX: 0000000000000000 RSI: 0000000000000296 RDI: ffff88810d3b23c8
RBP: ffffc90000b06948 R08: ffffffff8226874c R09: fffff94000938cd1
R10: 0000000000000000 R11: dffffc0000000001 R12: ffff88810d3b23c8
R13: 4000000000002005 R14: dffffc0000000000 R15: ffffea00049c6680
FS: 00007f7bcf38c6c0(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fe0938c8427 CR3: 0000000161336000 CR4: 00000000003526b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
try_to_release_page+0x194/0x1f0 mm/filemap.c:4037
shrink_page_list+0x1fd4/0x5c50 mm/vmscan.c:1762
shrink_inactive_list mm/vmscan.c:2304 [inline]
shrink_list mm/vmscan.c:2549 [inline]
shrink_lruvec+0x17ec/0x4580 mm/vmscan.c:5752
shrink_node_memcgs mm/vmscan.c:5944 [inline]
shrink_node+0x1077/0x24e0 mm/vmscan.c:5974
shrink_zones mm/vmscan.c:6177 [inline]
do_try_to_free_pages+0x5b6/0x1570 mm/vmscan.c:6235
try_to_free_pages+0x3a5/0xd70 mm/vmscan.c:6470
__perform_reclaim mm/page_alloc.c:4948 [inline]
__alloc_pages_direct_reclaim mm/page_alloc.c:4971 [inline]
__alloc_pages_slowpath+0x160a/0x3860 mm/page_alloc.c:5394
__alloc_pages+0x503/0x8f0 mm/page_alloc.c:5789
__vmalloc_area_node mm/vmalloc.c:2955 [inline]
__vmalloc_node_range+0x482/0x8d0 mm/vmalloc.c:3086
__bpf_map_area_alloc kernel/bpf/syscall.c:328 [inline]
bpf_map_area_alloc+0xd9/0xf0 kernel/bpf/syscall.c:335
queue_stack_map_alloc+0xc3/0x200 kernel/bpf/queue_stack_maps.c:76
find_and_alloc_map kernel/bpf/syscall.c:129 [inline]
map_create+0x411/0x2050 kernel/bpf/syscall.c:857
__sys_bpf+0x296/0x760 kernel/bpf/syscall.c:4600
__do_sys_bpf kernel/bpf/syscall.c:4722 [inline]
__se_sys_bpf kernel/bpf/syscall.c:4720 [inline]
__x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:4720
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7f7bd0609da9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f7bcf38c0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 00007f7bd0738f80 RCX: 00007f7bd0609da9
RDX: 0000000000000048 RSI: 0000000020000140 RDI: 0000000000000000
RBP: 00007f7bd065647a R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f7bd0738f80 R15: 00007ffe4f1772f8
Modules linked in:
---[ end trace d0743cda25a88441 ]---
RIP: 0010:f2fs_release_page+0x23a/0x7c0 fs/f2fs/data.c:3698
Code: 00 4c 03 23 4c 89 e0 48 c1 e8 03 42 80 3c 30 00 74 08 4c 89 e7 e8 86 7f 8b ff bb 18 07 00 00 49 03 1c 24 48 89 d8 48 c1 e8 03 <42> 0f b6 04 30 84 c0 0f 85 3c 05 00 00 44 8b 23 bb 00 00 00 40 be
RSP: 0000:ffffc90000b06908 EFLAGS: 00010202
RAX: 00000000000000e3 RBX: 0000000000000718 RCX: ffffffff8226881a
RDX: 0000000000000000 RSI: 0000000000000296 RDI: ffff88810d3b23c8
RBP: ffffc90000b06948 R08: ffffffff8226874c R09: fffff94000938cd1
----------------
Code disassembly (best guess):
0: 00 4c 03 23 add %cl,0x23(%rbx,%rax,1)
4: 4c 89 e0 mov %r12,%rax
7: 48 c1 e8 03 shr $0x3,%rax
b: 42 80 3c 30 00 cmpb $0x0,(%rax,%r14,1)
10: 74 08 je 0x1a
12: 4c 89 e7 mov %r12,%rdi
15: e8 86 7f 8b ff call 0xff8b7fa0
1a: bb 18 07 00 00 mov $0x718,%ebx
1f: 49 03 1c 24 add (%r12),%rbx
23: 48 89 d8 mov %rbx,%rax
26: 48 c1 e8 03 shr $0x3,%rax
* 2a: 42 0f b6 04 30 movzbl (%rax,%r14,1),%eax <-- trapping instruction
2f: 84 c0 test %al,%al
31: 0f 85 3c 05 00 00 jne 0x573
37: 44 8b 23 mov (%rbx),%r12d
3a: bb 00 00 00 40 mov $0x40000000,%ebx
3f: be .byte 0xbe