==================================================================
BUG: KASAN: use-after-free in tcp_probe_timer net/ipv4/tcp_timer.c:388 [inline]
BUG: KASAN: use-after-free in tcp_write_timer_handler+0x7ef/0x930 net/ipv4/tcp_timer.c:652
Read of size 1 at addr ffff88807e098745 by task syz-executor.4/22489
CPU: 1 PID: 22489 Comm: syz-executor.4 Not tainted 6.1.82-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/29/2024
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
print_address_description mm/kasan/report.c:284 [inline]
print_report+0x15f/0x4f0 mm/kasan/report.c:395
kasan_report+0x136/0x160 mm/kasan/report.c:495
tcp_probe_timer net/ipv4/tcp_timer.c:388 [inline]
tcp_write_timer_handler+0x7ef/0x930 net/ipv4/tcp_timer.c:652
tcp_write_timer+0x12e/0x280 net/ipv4/tcp_timer.c:665
call_timer_fn+0x1ad/0x6b0 kernel/time/timer.c:1474
expire_timers kernel/time/timer.c:1519 [inline]
__run_timers+0x67c/0x890 kernel/time/timer.c:1790
run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1803
__do_softirq+0x2e9/0xa4c kernel/softirq.c:571
invoke_softirq kernel/softirq.c:445 [inline]
__irq_exit_rcu+0x155/0x240 kernel/softirq.c:650
irq_exit_rcu+0x5/0x20 kernel/softirq.c:662
sysvec_apic_timer_interrupt+0x91/0xb0 arch/x86/kernel/apic/apic.c:1106
asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:653
RIP: 0010:__raw_spin_unlock_irq include/linux/spinlock_api_smp.h:160 [inline]
RIP: 0010:_raw_spin_unlock_irq+0x25/0x40 kernel/locking/spinlock.c:202
Code: 41 bd f5 ff 90 53 48 89 fb 48 83 c7 18 48 8b 74 24 08 e8 9e ac d6 f6 48 89 df e8 06 ea d7 f6 e8 e1 78 fd f6 fb bf 01 00 00 00 76 78 ca f6 65 8b 05 37 a4 6e 75 85 c0 74 02 5b c3 e8 74 c2 6c
RSP: 0018:ffffc90006a17c10 EFLAGS: 00000282
RAX: 15831a060737fc00 RBX: ffff88807b7e39a8 RCX: ffffffff91c8e103
RDX: dffffc0000000000 RSI: ffffffff8aebee40 RDI: 0000000000000001
RBP: ffff88807b7e39f7 R08: dffffc0000000000 R09: ffffed100f6fc736
R10: 0000000000000000 R11: dffffc0000000001 R12: dffffc0000000000
R13: ffff88807b7e39f8 R14: 000000000077f491 R15: ffff88807b7e39a8
spin_unlock_irq include/linux/spinlock.h:401 [inline]
mousedev_write+0x55e/0x920 drivers/input/mousedev.c:706
vfs_write+0x2d9/0xba0 fs/read_write.c:582
ksys_write+0x19c/0x2c0 fs/read_write.c:637
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f86ba27dda9
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:00007f86bb0b30c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007f86ba3abf80 RCX: 00007f86ba27dda9
RDX: 00000000fffffde5 RSI: 0000000020000140 RDI: 0000000000000003
RBP: 00007f86ba2ca47a R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f86ba3abf80 R15: 00007fff07f9a168
Allocated by task 13369:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
__kasan_slab_alloc+0x65/0x70 mm/kasan/common.c:328
kasan_slab_alloc include/linux/kasan.h:201 [inline]
slab_post_alloc_hook+0x52/0x3a0 mm/slab.h:737
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+0x10c/0x2d0 mm/slub.c:3422
kmem_cache_zalloc include/linux/slab.h:682 [inline]
net_alloc net/core/net_namespace.c:410 [inline]
copy_net_ns+0x143/0x5d0 net/core/net_namespace.c:465
create_new_namespaces+0x425/0x7a0 kernel/nsproxy.c:110
unshare_nsproxy_namespaces+0x11e/0x170 kernel/nsproxy.c:226
ksys_unshare+0x580/0xb20 kernel/fork.c:3203
__do_sys_unshare kernel/fork.c:3274 [inline]
__se_sys_unshare kernel/fork.c:3272 [inline]
__x64_sys_unshare+0x34/0x40 kernel/fork.c:3272
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x63/0xcd
Last potentially related work creation:
kasan_save_stack+0x3b/0x60 mm/kasan/common.c:45
__kasan_record_aux_stack+0xb0/0xc0 mm/kasan/generic.c:486
insert_work+0x54/0x3d0 kernel/workqueue.c:1361
__queue_work+0xb4b/0xf90 kernel/workqueue.c:1520
call_timer_fn+0x1ad/0x6b0 kernel/time/timer.c:1474
expire_timers kernel/time/timer.c:1514 [inline]
__run_timers+0x6a8/0x890 kernel/time/timer.c:1790
__do_softirq+0x2e9/0xa4c kernel/softirq.c:571
The buggy address belongs to the object at ffff88807e098000
which belongs to the cache net_namespace of size 6976
The buggy address is located 1861 bytes inside of
6976-byte region [ffff88807e098000, ffff88807e099b40)
The buggy address belongs to the physical page:
page:ffffea0001f82600 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88807e098000 pfn:0x7e098
head:ffffea0001f82600 order:3 compound_mapcount:0 compound_pincount:0
memcg:ffff88807932d541
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 ffffea0001d3be00 dead000000000003 ffff888140009500
raw: ffff88807e098000 0000000080040002 00000001ffffffff ffff88807932d541
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 13369, tgid 13369 (syz-executor.0), ts 419925906568, free_ts 419924180242
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x18d/0x1b0 mm/page_alloc.c:2513
prep_new_page mm/page_alloc.c:2520 [inline]
get_page_from_freelist+0x31a1/0x3320 mm/page_alloc.c:4279
__alloc_pages+0x28d/0x770 mm/page_alloc.c:5545
alloc_slab_page+0x6a/0x150 mm/slub.c:1794
allocate_slab mm/slub.c:1939 [inline]
new_slab+0x84/0x2d0 mm/slub.c:1992
___slab_alloc+0xc20/0x1270 mm/slub.c:3180
__slab_alloc mm/slub.c:3279 [inline]
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+0x1a5/0x2d0 mm/slub.c:3422
kmem_cache_zalloc include/linux/slab.h:682 [inline]
net_alloc net/core/net_namespace.c:410 [inline]
copy_net_ns+0x143/0x5d0 net/core/net_namespace.c:465
create_new_namespaces+0x425/0x7a0 kernel/nsproxy.c:110
unshare_nsproxy_namespaces+0x11e/0x170 kernel/nsproxy.c:226
ksys_unshare+0x580/0xb20 kernel/fork.c:3203
__do_sys_unshare kernel/fork.c:3274 [inline]
__se_sys_unshare kernel/fork.c:3272 [inline]
__x64_sys_unshare+0x34/0x40 kernel/fork.c:3272
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81
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:1440 [inline]
free_pcp_prepare mm/page_alloc.c:1490 [inline]
free_unref_page_prepare+0xf63/0x1120 mm/page_alloc.c:3358
free_unref_page+0x33/0x3e0 mm/page_alloc.c:3453
free_large_kmalloc+0xfb/0x190 mm/slab_common.c:932
skb_free_head net/core/skbuff.c:762 [inline]
skb_release_data+0x5de/0x7a0 net/core/skbuff.c:791
skb_release_all net/core/skbuff.c:856 [inline]
__kfree_skb net/core/skbuff.c:870 [inline]
consume_skb+0xa3/0x140 net/core/skbuff.c:1035
netlink_recvmsg+0x61a/0x1180 net/netlink/af_netlink.c:1952
____sys_recvmsg+0x285/0x530
___sys_recvmsg net/socket.c:2775 [inline]
__sys_recvmsg+0x2e9/0x3d0 net/socket.c:2805
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x63/0xcd
Memory state around the buggy address:
ffff88807e098600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88807e098680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88807e098700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88807e098780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88807e098800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: 41 bd f5 ff 90 53 mov $0x5390fff5,%r13d
6: 48 89 fb mov %rdi,%rbx
9: 48 83 c7 18 add $0x18,%rdi
d: 48 8b 74 24 08 mov 0x8(%rsp),%rsi
12: e8 9e ac d6 f6 call 0xf6d6acb5
17: 48 89 df mov %rbx,%rdi
1a: e8 06 ea d7 f6 call 0xf6d7ea25
1f: e8 e1 78 fd f6 call 0xf6fd7905
24: fb sti
25: bf 01 00 00 00 mov $0x1,%edi
* 2a: e8 76 78 ca f6 call 0xf6ca78a5 <-- trapping instruction
2f: 65 8b 05 37 a4 6e 75 mov %gs:0x756ea437(%rip),%eax # 0x756ea46d
36: 85 c0 test %eax,%eax
38: 74 02 je 0x3c
3a: 5b pop %rbx
3b: c3 ret
3c: e8 .byte 0xe8
3d: 74 c2 je 0x1
3f: 6c insb (%dx),%es:(%rdi)