==================================================================
BUG: KASAN: use-after-free in tcp_probe_timer net/ipv4/tcp_timer.c:378 [inline]
BUG: KASAN: use-after-free in tcp_write_timer_handler net/ipv4/tcp_timer.c:624 [inline]
BUG: KASAN: use-after-free in tcp_write_timer_handler+0x99c/0x9f0 net/ipv4/tcp_timer.c:594
Read of size 1 at addr ffff888034175c05 by task kworker/u4:14/24191
CPU: 1 PID: 24191 Comm: kworker/u4:14 Not tainted 6.1.0-rc5-syzkaller-00015-g81e7cfa3a9eb #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
Workqueue: bat_events batadv_nc_worker
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xd1/0x138 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:284 [inline]
print_report+0x15e/0x45d mm/kasan/report.c:395
kasan_report+0xbf/0x1f0 mm/kasan/report.c:495
tcp_probe_timer net/ipv4/tcp_timer.c:378 [inline]
tcp_write_timer_handler net/ipv4/tcp_timer.c:624 [inline]
tcp_write_timer_handler+0x99c/0x9f0 net/ipv4/tcp_timer.c:594
tcp_write_timer+0xa6/0x2b0 net/ipv4/tcp_timer.c:637
call_timer_fn+0x1da/0x7c0 kernel/time/timer.c:1474
expire_timers kernel/time/timer.c:1519 [inline]
__run_timers.part.0+0x6a2/0xaf0 kernel/time/timer.c:1790
__run_timers kernel/time/timer.c:1768 [inline]
run_timer_softirq+0xb7/0x1d0 kernel/time/timer.c:1803
__do_softirq+0x1fb/0xadc kernel/softirq.c:571
do_softirq.part.0+0xde/0x130 kernel/softirq.c:472
do_softirq kernel/softirq.c:464 [inline]
__local_bh_enable_ip+0x106/0x130 kernel/softirq.c:396
spin_unlock_bh include/linux/spinlock.h:395 [inline]
batadv_nc_purge_paths+0x2a5/0x3a0 net/batman-adv/network-coding.c:471
batadv_nc_worker+0x8fd/0xfa0 net/batman-adv/network-coding.c:720
process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289
worker_thread+0x669/0x1090 kernel/workqueue.c:2436
kthread+0x2e8/0x3a0 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306
Allocated by task 20209:
kasan_save_stack+0x22/0x40 mm/kasan/common.c:45
kasan_set_track+0x25/0x30 mm/kasan/common.c:52
__kasan_slab_alloc+0x82/0x90 mm/kasan/common.c:325
kasan_slab_alloc include/linux/kasan.h:201 [inline]
slab_post_alloc_hook mm/slab.h:737 [inline]
slab_alloc_node mm/slub.c:3398 [inline]
slab_alloc mm/slub.c:3406 [inline]
__kmem_cache_alloc_lru mm/slub.c:3413 [inline]
kmem_cache_alloc+0x2b4/0x3d0 mm/slub.c:3422
kmem_cache_zalloc include/linux/slab.h:679 [inline]
net_alloc net/core/net_namespace.c:410 [inline]
copy_net_ns+0x129/0x760 net/core/net_namespace.c:465
create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110
unshare_nsproxy_namespaces+0xc5/0x1f0 kernel/nsproxy.c:226
ksys_unshare+0x449/0x920 kernel/fork.c:3188
__do_sys_unshare kernel/fork.c:3259 [inline]
__se_sys_unshare kernel/fork.c:3257 [inline]
__x64_sys_unshare+0x31/0x40 kernel/fork.c:3257
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
Last potentially related work creation:
kasan_save_stack+0x22/0x40 mm/kasan/common.c:45
__kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:481
insert_work+0x48/0x350 kernel/workqueue.c:1358
__queue_work+0x693/0x13b0 kernel/workqueue.c:1517
call_timer_fn+0x1da/0x7c0 kernel/time/timer.c:1474
expire_timers kernel/time/timer.c:1514 [inline]
__run_timers.part.0+0x4a3/0xaf0 kernel/time/timer.c:1790
__run_timers kernel/time/timer.c:1768 [inline]
run_timer_softirq+0x156/0x1d0 kernel/time/timer.c:1805
__do_softirq+0x1fb/0xadc kernel/softirq.c:571
Second to last potentially related work creation:
kasan_save_stack+0x22/0x40 mm/kasan/common.c:45
__kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:481
insert_work+0x48/0x350 kernel/workqueue.c:1358
__queue_work+0x693/0x13b0 kernel/workqueue.c:1517
call_timer_fn+0x1da/0x7c0 kernel/time/timer.c:1474
expire_timers kernel/time/timer.c:1514 [inline]
__run_timers.part.0+0x4a3/0xaf0 kernel/time/timer.c:1790
__run_timers kernel/time/timer.c:1768 [inline]
run_timer_softirq+0x156/0x1d0 kernel/time/timer.c:1805
__do_softirq+0x1fb/0xadc kernel/softirq.c:571
The buggy address belongs to the object at ffff8880341754c0
which belongs to the cache net_namespace of size 6976
The buggy address is located 1861 bytes inside of
6976-byte region [ffff8880341754c0, ffff888034177000)
The buggy address belongs to the physical page:
page:ffffea0000d05c00 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8880341754c0 pfn:0x34170
head:ffffea0000d05c00 order:3 compound_mapcount:0 compound_pincount:0
memcg:ffff8880747f4a41
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 ffffea00011d0808 ffffea0001ed2608 ffff8880121e1500
raw: ffff8880341754c0 0000000000040001 00000001ffffffff ffff8880747f4a41
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 9628, tgid 9627 (syz-executor.2), ts 504986499806, free_ts 503428136993
prep_new_page mm/page_alloc.c:2539 [inline]
get_page_from_freelist+0x10b5/0x2d50 mm/page_alloc.c:4288
__alloc_pages+0x1cb/0x5b0 mm/page_alloc.c:5555
alloc_pages+0x1aa/0x270 mm/mempolicy.c:2285
alloc_slab_page mm/slub.c:1794 [inline]
allocate_slab+0x213/0x300 mm/slub.c:1939
new_slab mm/slub.c:1992 [inline]
___slab_alloc+0xa91/0x1400 mm/slub.c:3180
__slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3279
slab_alloc_node mm/slub.c:3364 [inline]
slab_alloc mm/slub.c:3406 [inline]
__kmem_cache_alloc_lru mm/slub.c:3413 [inline]
kmem_cache_alloc+0x31a/0x3d0 mm/slub.c:3422
kmem_cache_zalloc include/linux/slab.h:679 [inline]
net_alloc net/core/net_namespace.c:410 [inline]
copy_net_ns+0x129/0x760 net/core/net_namespace.c:465
create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110
unshare_nsproxy_namespaces+0xc5/0x1f0 kernel/nsproxy.c:226
ksys_unshare+0x449/0x920 kernel/fork.c:3188
__do_sys_unshare kernel/fork.c:3259 [inline]
__se_sys_unshare kernel/fork.c:3257 [inline]
__x64_sys_unshare+0x31/0x40 kernel/fork.c:3257
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1459 [inline]
free_pcp_prepare+0x65c/0xd90 mm/page_alloc.c:1509
free_unref_page_prepare mm/page_alloc.c:3387 [inline]
free_unref_page+0x1d/0x4d0 mm/page_alloc.c:3483
__unfreeze_partials+0x17c/0x1a0 mm/slub.c:2586
qlink_free mm/kasan/quarantine.c:168 [inline]
qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:187
kasan_quarantine_reduce+0x184/0x210 mm/kasan/quarantine.c:294
__kasan_slab_alloc+0x66/0x90 mm/kasan/common.c:302
kasan_slab_alloc include/linux/kasan.h:201 [inline]
slab_post_alloc_hook mm/slab.h:737 [inline]
slab_alloc_node mm/slub.c:3398 [inline]
__kmem_cache_alloc_node+0x2e2/0x3e0 mm/slub.c:3437
__do_kmalloc_node mm/slab_common.c:954 [inline]
__kmalloc_node+0x4d/0xd0 mm/slab_common.c:962
kmalloc_node include/linux/slab.h:579 [inline]
kvmalloc_node+0x43/0x1b0 mm/util.c:581
kvmalloc include/linux/slab.h:706 [inline]
kvzalloc include/linux/slab.h:714 [inline]
allocate_hook_entries_size net/netfilter/core.c:61 [inline]
__nf_hook_entries_try_shrink+0x149/0x4d0 net/netfilter/core.c:248
__nf_unregister_net_hook+0x1bb/0x6d0 net/netfilter/core.c:508
nf_unregister_net_hook net/netfilter/core.c:527 [inline]
nf_unregister_net_hooks+0x11b/0x160 net/netfilter/core.c:601
nf_ct_netns_do_put+0x33a/0x530 net/netfilter/nf_conntrack_proto.c:560
nf_ct_netns_put net/netfilter/nf_conntrack_proto.c:641 [inline]
nf_ct_netns_put+0x4d/0x80 net/netfilter/nf_conntrack_proto.c:634
nf_conncount_destroy+0x49/0x190 net/netfilter/nf_conncount.c:592
ovs_ct_limit_exit net/openvswitch/conntrack.c:1918 [inline]
ovs_ct_exit+0x1ad/0x4a0 net/openvswitch/conntrack.c:2321
Memory state around the buggy address:
ffff888034175b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888034175b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888034175c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888034175c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888034175d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================