==================================================================
BUG: KASAN: use-after-free in instrument_atomic_read include/linux/instrumented.h:71 [inline]
BUG: KASAN: use-after-free in atomic_read include/linux/atomic/atomic-instrumented.h:27 [inline]
BUG: KASAN: use-after-free in refcount_read include/linux/refcount.h:147 [inline]
BUG: KASAN: use-after-free in skb_unref include/linux/skbuff.h:1131 [inline]
BUG: KASAN: use-after-free in consume_skb+0x3c/0x250 net/core/skbuff.c:926
Read of size 4 at addr ffff88814e9bf22c by task kworker/1:16/11842
CPU: 1 PID: 11842 Comm: kworker/1:16 Tainted: G W 5.15.167-syzkaller-00002-g3bfe08931bff #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Workqueue: events bpf_map_free_deferred
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x151/0x1c0 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
kasan_check_range+0x293/0x2a0 mm/kasan/generic.c:189
__kasan_check_read+0x11/0x20 mm/kasan/shadow.c:31
instrument_atomic_read include/linux/instrumented.h:71 [inline]
atomic_read include/linux/atomic/atomic-instrumented.h:27 [inline]
refcount_read include/linux/refcount.h:147 [inline]
skb_unref include/linux/skbuff.h:1131 [inline]
consume_skb+0x3c/0x250 net/core/skbuff.c:926
__sk_msg_free+0x2dd/0x370 net/core/skmsg.c:205
sk_msg_free net/core/skmsg.c:218 [inline]
__sk_psock_purge_ingress_msg net/core/skmsg.c:769 [inline]
__sk_psock_zap_ingress net/core/skmsg.c:787 [inline]
sk_psock_stop+0x44c/0x4d0 net/core/skmsg.c:805
sk_psock_drop+0x219/0x310 net/core/skmsg.c:844
sk_psock_put include/linux/skmsg.h:458 [inline]
sock_map_unref+0x48f/0x4d0 net/core/sock_map.c:183
sock_map_free+0x137/0x2b0 net/core/sock_map.c:353
bpf_map_free_deferred+0x10d/0x1e0 kernel/bpf/syscall.c:481
process_one_work+0x6bb/0xc10 kernel/workqueue.c:2325
worker_thread+0xad5/0x12a0 kernel/workqueue.c:2472
kthread+0x421/0x510 kernel/kthread.c:337
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
Allocated by task 13049:
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_slab_alloc+0xb1/0xe0 mm/kasan/common.c:466
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
skb_clone+0x1d1/0x360 net/core/skbuff.c:1547
sk_psock_verdict_recv+0x53/0x840 net/core/skmsg.c:1183
unix_read_sock+0x132/0x370 net/unix/af_unix.c:2428
sk_psock_verdict_data_ready+0x147/0x1a0 net/core/skmsg.c:1226
unix_dgram_sendmsg+0x15fa/0x2090 net/unix/af_unix.c:1942
sock_sendmsg_nosec net/socket.c:704 [inline]
__sock_sendmsg net/socket.c:716 [inline]
____sys_sendmsg+0x59e/0x8f0 net/socket.c:2431
___sys_sendmsg+0x252/0x2e0 net/socket.c:2485
__sys_sendmsg net/socket.c:2514 [inline]
__do_sys_sendmsg net/socket.c:2523 [inline]
__se_sys_sendmsg+0x19a/0x260 net/socket.c:2521
__x64_sys_sendmsg+0x7b/0x90 net/socket.c:2521
x64_sys_call+0x16a/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:47
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
Freed by task 20:
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]
kmem_cache_free+0x116/0x2e0 mm/slub.c:3535
kfree_skbmem+0x104/0x170
__kfree_skb net/core/skbuff.c:758 [inline]
kfree_skb_reason net/core/skbuff.c:778 [inline]
kfree_skb+0xc2/0x360 net/core/skbuff.c:792
sock_drop include/linux/skmsg.h:312 [inline]
sk_psock_backlog+0xc21/0xd90 net/core/skmsg.c:682
process_one_work+0x6bb/0xc10 kernel/workqueue.c:2325
worker_thread+0xad5/0x12a0 kernel/workqueue.c:2472
kthread+0x421/0x510 kernel/kthread.c:337
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
The buggy address belongs to the object at ffff88814e9bf140
which belongs to the cache skbuff_head_cache of size 248
The buggy address is located 236 bytes inside of
248-byte region [ffff88814e9bf140, ffff88814e9bf238)
The buggy address belongs to the page:
page:ffffea00053a6fc0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x14e9bf
flags: 0x4000000000000200(slab|zone=1)
raw: 4000000000000200 ffffea0004866ac0 0000000600000006 ffff8881081b2300
raw: 0000000000000000 00000000000c000c 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x112a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_HARDWALL), pid 11396, ts 590627380409, free_ts 590625015414
set_page_owner include/linux/page_owner.h:33 [inline]
post_alloc_hook+0x1a3/0x1b0 mm/page_alloc.c:2605
prep_new_page+0x1b/0x110 mm/page_alloc.c:2611
get_page_from_freelist+0x3550/0x35d0 mm/page_alloc.c:4485
__alloc_pages+0x27e/0x8f0 mm/page_alloc.c:5779
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]
kmem_cache_alloc+0x134/0x200 mm/slub.c:3253
kmem_cache_alloc_node include/linux/slab.h:474 [inline]
__alloc_skb+0xbe/0x550 net/core/skbuff.c:416
alloc_skb include/linux/skbuff.h:1183 [inline]
nlmsg_new include/net/netlink.h:953 [inline]
inet6_ifa_notify net/ipv6/addrconf.c:5539 [inline]
__ipv6_ifa_notify+0x2e1/0x11c0 net/ipv6/addrconf.c:6181
addrconf_ifdown+0xe14/0x1ae0 net/ipv6/addrconf.c:3922
addrconf_notify+0x37d/0xdd0
notifier_call_chain kernel/notifier.c:83 [inline]
raw_notifier_call_chain+0x8c/0xf0 kernel/notifier.c:391
call_netdevice_notifiers_info net/core/dev.c:2026 [inline]
call_netdevice_notifiers_extack net/core/dev.c:2038 [inline]
call_netdevice_notifiers net/core/dev.c:2052 [inline]
dev_close_many+0x37c/0x530 net/core/dev.c:1627
vlan_device_event+0x1622/0x1d80 net/8021q/vlan.c:450
notifier_call_chain kernel/notifier.c:83 [inline]
raw_notifier_call_chain+0x8c/0xf0 kernel/notifier.c:391
page last free stack trace:
reset_page_owner include/linux/page_owner.h:26 [inline]
free_pages_prepare mm/page_alloc.c:1472 [inline]
free_pcp_prepare mm/page_alloc.c:1544 [inline]
free_unref_page_prepare+0x7c8/0x7d0 mm/page_alloc.c:3534
free_unref_page+0xe8/0x750 mm/page_alloc.c:3616
free_the_page mm/page_alloc.c:805 [inline]
__free_pages+0x61/0xf0 mm/page_alloc.c:5855
__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_trace+0xf9/0x210 mm/slub.c:3265
kmalloc include/linux/slab.h:603 [inline]
kzalloc include/linux/slab.h:733 [inline]
nf_nat_masq_schedule+0x2f3/0x620 net/netfilter/nf_nat_masquerade.c:114
masq_device_event+0xa0/0xd0 net/netfilter/nf_nat_masquerade.c:157
Memory state around the buggy address:
ffff88814e9bf100: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb
ffff88814e9bf180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88814e9bf200: fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc fc
^
ffff88814e9bf280: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88814e9bf300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc
==================================================================
==================================================================
BUG: KASAN: double-free or invalid-free in slab_free mm/slub.c:3519 [inline]
BUG: KASAN: double-free or invalid-free in kmem_cache_free+0x116/0x2e0 mm/slub.c:3535
CPU: 1 PID: 11842 Comm: kworker/1:16 Tainted: G B W 5.15.167-syzkaller-00002-g3bfe08931bff #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Workqueue: events bpf_map_free_deferred
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x151/0x1c0 lib/dump_stack.c:106
print_address_description+0x87/0x3b0 mm/kasan/report.c:248
kasan_report_invalid_free+0x6b/0xa0 mm/kasan/report.c:370
____kasan_slab_free+0x13e/0x160
__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]
kmem_cache_free+0x116/0x2e0 mm/slub.c:3535
kfree_skbmem+0x104/0x170
__kfree_skb net/core/skbuff.c:758 [inline]
consume_skb+0xb4/0x250 net/core/skbuff.c:930
__sk_msg_free+0x2dd/0x370 net/core/skmsg.c:205
sk_msg_free net/core/skmsg.c:218 [inline]
__sk_psock_purge_ingress_msg net/core/skmsg.c:769 [inline]
__sk_psock_zap_ingress net/core/skmsg.c:787 [inline]
sk_psock_stop+0x44c/0x4d0 net/core/skmsg.c:805
sk_psock_drop+0x219/0x310 net/core/skmsg.c:844
sk_psock_put include/linux/skmsg.h:458 [inline]
sock_map_unref+0x48f/0x4d0 net/core/sock_map.c:183
sock_map_free+0x137/0x2b0 net/core/sock_map.c:353
bpf_map_free_deferred+0x10d/0x1e0 kernel/bpf/syscall.c:481
process_one_work+0x6bb/0xc10 kernel/workqueue.c:2325
worker_thread+0xad5/0x12a0 kernel/workqueue.c:2472
kthread+0x421/0x510 kernel/kthread.c:337
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
Allocated by task 13049:
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_slab_alloc+0xb1/0xe0 mm/kasan/common.c:466
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
skb_clone+0x1d1/0x360 net/core/skbuff.c:1547
sk_psock_verdict_recv+0x53/0x840 net/core/skmsg.c:1183
unix_read_sock+0x132/0x370 net/unix/af_unix.c:2428
sk_psock_verdict_data_ready+0x147/0x1a0 net/core/skmsg.c:1226
unix_dgram_sendmsg+0x15fa/0x2090 net/unix/af_unix.c:1942
sock_sendmsg_nosec net/socket.c:704 [inline]
__sock_sendmsg net/socket.c:716 [inline]
____sys_sendmsg+0x59e/0x8f0 net/socket.c:2431
___sys_sendmsg+0x252/0x2e0 net/socket.c:2485
__sys_sendmsg net/socket.c:2514 [inline]
__do_sys_sendmsg net/socket.c:2523 [inline]
__se_sys_sendmsg+0x19a/0x260 net/socket.c:2521
__x64_sys_sendmsg+0x7b/0x90 net/socket.c:2521
x64_sys_call+0x16a/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:47
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
Freed by task 20:
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]
kmem_cache_free+0x116/0x2e0 mm/slub.c:3535
kfree_skbmem+0x104/0x170
__kfree_skb net/core/skbuff.c:758 [inline]
kfree_skb_reason net/core/skbuff.c:778 [inline]
kfree_skb+0xc2/0x360 net/core/skbuff.c:792
sock_drop include/linux/skmsg.h:312 [inline]
sk_psock_backlog+0xc21/0xd90 net/core/skmsg.c:682
process_one_work+0x6bb/0xc10 kernel/workqueue.c:2325
worker_thread+0xad5/0x12a0 kernel/workqueue.c:2472
kthread+0x421/0x510 kernel/kthread.c:337
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
The buggy address belongs to the object at ffff88814e9bf140
which belongs to the cache skbuff_head_cache of size 248
The buggy address is located 0 bytes inside of
248-byte region [ffff88814e9bf140, ffff88814e9bf238)
The buggy address belongs to the page:
page:ffffea00053a6fc0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x14e9bf
flags: 0x4000000000000200(slab|zone=1)
raw: 4000000000000200 ffffea0004866ac0 0000000600000006 ffff8881081b2300
raw: 0000000000000000 00000000000c000c 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x112a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_HARDWALL), pid 11396, ts 590627380409, free_ts 590625015414
set_page_owner include/linux/page_owner.h:33 [inline]
post_alloc_hook+0x1a3/0x1b0 mm/page_alloc.c:2605
prep_new_page+0x1b/0x110 mm/page_alloc.c:2611
get_page_from_freelist+0x3550/0x35d0 mm/page_alloc.c:4485
__alloc_pages+0x27e/0x8f0 mm/page_alloc.c:5779
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]
kmem_cache_alloc+0x134/0x200 mm/slub.c:3253
kmem_cache_alloc_node include/linux/slab.h:474 [inline]
__alloc_skb+0xbe/0x550 net/core/skbuff.c:416
alloc_skb include/linux/skbuff.h:1183 [inline]
nlmsg_new include/net/netlink.h:953 [inline]
inet6_ifa_notify net/ipv6/addrconf.c:5539 [inline]
__ipv6_ifa_notify+0x2e1/0x11c0 net/ipv6/addrconf.c:6181
addrconf_ifdown+0xe14/0x1ae0 net/ipv6/addrconf.c:3922
addrconf_notify+0x37d/0xdd0
notifier_call_chain kernel/notifier.c:83 [inline]
raw_notifier_call_chain+0x8c/0xf0 kernel/notifier.c:391
call_netdevice_notifiers_info net/core/dev.c:2026 [inline]
call_netdevice_notifiers_extack net/core/dev.c:2038 [inline]
call_netdevice_notifiers net/core/dev.c:2052 [inline]
dev_close_many+0x37c/0x530 net/core/dev.c:1627
vlan_device_event+0x1622/0x1d80 net/8021q/vlan.c:450
notifier_call_chain kernel/notifier.c:83 [inline]
raw_notifier_call_chain+0x8c/0xf0 kernel/notifier.c:391
page last free stack trace:
reset_page_owner include/linux/page_owner.h:26 [inline]
free_pages_prepare mm/page_alloc.c:1472 [inline]
free_pcp_prepare mm/page_alloc.c:1544 [inline]
free_unref_page_prepare+0x7c8/0x7d0 mm/page_alloc.c:3534
free_unref_page+0xe8/0x750 mm/page_alloc.c:3616
free_the_page mm/page_alloc.c:805 [inline]
__free_pages+0x61/0xf0 mm/page_alloc.c:5855
__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_trace+0xf9/0x210 mm/slub.c:3265
kmalloc include/linux/slab.h:603 [inline]
kzalloc include/linux/slab.h:733 [inline]
nf_nat_masq_schedule+0x2f3/0x620 net/netfilter/nf_nat_masquerade.c:114
masq_device_event+0xa0/0xd0 net/netfilter/nf_nat_masquerade.c:157
Memory state around the buggy address:
ffff88814e9bf000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88814e9bf080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc
>ffff88814e9bf100: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb
^
ffff88814e9bf180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88814e9bf200: fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc fc
==================================================================