kasan: CONFIG_KASAN_INLINE enabled ================================================================== BUG: KASAN: use-after-free in tcp_retransmit_timer+0x2fc3/0x33f0 net/ipv4/tcp_timer.c:480 Read of size 8 at addr ffff8880a52ac338 by task syz-executor.4/29673 CPU: 1 PID: 29673 Comm: syz-executor.4 Not tainted 4.19.211-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: kasan: GPF could be caused by NULL-ptr deref or user memory access __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1fc/0x2ef lib/dump_stack.c:118 print_address_description.cold+0x54/0x219 mm/kasan/report.c:256 kasan_report_error.cold+0x8a/0x1b9 mm/kasan/report.c:354 kasan_report mm/kasan/report.c:412 [inline] __asan_report_load8_noabort+0x88/0x90 mm/kasan/report.c:433 tcp_retransmit_timer+0x2fc3/0x33f0 net/ipv4/tcp_timer.c:480 general protection fault: 0000 [#1] PREEMPT SMP KASAN CPU: 0 PID: 29603 Comm: syz-executor.3 Not tainted 4.19.211-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:sock_prot_inuse_add+0x6d/0x90 net/core/sock.c:3172 Code: 48 8b ad 20 02 00 00 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 0f b6 04 02 84 c0 74 04 3c 03 7e 11 8b 83 c8 00 00 00 <65> 44 01 64 85 00 5b 5d 41 5c c3 e8 13 8c 29 fb eb e8 e8 9c 8c 29 RSP: 0018:ffff8880ba007a48 EFLAGS: 00010246 tcp_write_timer_handler+0x5e6/0xa60 net/ipv4/tcp_timer.c:593 RAX: 0000000000000007 RBX: ffffffff8aed2900 RCX: ffffffff83771e23 tcp_write_timer+0x103/0x1b0 net/ipv4/tcp_timer.c:613 RDX: 1ffffffff15da539 RSI: ffffffff83771e31 RDI: ffffffff8aed29c8 call_timer_fn+0x177/0x700 kernel/time/timer.c:1338 RBP: 6564752f6e75722f R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000005 R11: 0000000000000000 R12: 00000000ffffffff R13: ffff8880b164b578 R14: ffffc90000df21e8 R15: 0000000000000001 FS: 00007f7f69532700(0000) GS:ffff8880ba000000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f02ec0cb862 CR3: 000000009e336000 CR4: 00000000003406f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 expire_timers+0x243/0x4e0 kernel/time/timer.c:1375 Call Trace: __run_timers kernel/time/timer.c:1696 [inline] run_timer_softirq+0x21c/0x670 kernel/time/timer.c:1709 inet_unhash+0x418/0x700 net/ipv4/inet_hashtables.c:659 tcp_set_state+0x1a8/0x7d0 net/ipv4/tcp.c:2244 __do_softirq+0x265/0x980 kernel/softirq.c:292 invoke_softirq kernel/softirq.c:372 [inline] irq_exit+0x215/0x260 kernel/softirq.c:412 exiting_irq arch/x86/include/asm/apic.h:536 [inline] smp_apic_timer_interrupt+0x136/0x550 arch/x86/kernel/apic/apic.c:1098 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:894 tcp_done+0xa9/0x2a0 net/ipv4/tcp.c:3789 RIP: 0010:arch_local_irq_restore arch/x86/include/asm/paravirt.h:789 [inline] RIP: 0010:lock_is_held_type+0x17a/0x210 kernel/locking/lockdep.c:3948 tcp_write_err net/ipv4/tcp_timer.c:55 [inline] tcp_write_timeout net/ipv4/tcp_timer.c:262 [inline] tcp_retransmit_timer+0x1f96/0x33f0 net/ipv4/tcp_timer.c:481 Code: 00 00 00 00 fc ff df c7 85 84 08 00 00 00 00 00 00 48 c1 e8 03 80 3c 10 00 75 63 48 83 3d 45 cc a6 08 00 74 2c 48 89 df 57 9d <0f> 1f 44 00 00 48 83 c4 08 44 89 e0 5b 5d 41 5c c3 48 83 c4 08 41 RSP: 0018:ffff88809b167a80 EFLAGS: 00000286 ORIG_RAX: ffffffffffffff13 RAX: 1ffffffff13e3051 RBX: 0000000000000286 RCX: 0000000000000000 RDX: dffffc0000000000 RSI: 00000000ffffffff RDI: 0000000000000286 RBP: ffff88809013a0c0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000005 R11: 0000000000000000 R12: 0000000000000000 tcp_write_timer_handler+0x5e6/0xa60 net/ipv4/tcp_timer.c:593 R13: 00000000000003ab R14: 0000000000001000 R15: ffff88805280be70 tcp_write_timer+0x103/0x1b0 net/ipv4/tcp_timer.c:613 lock_is_held include/linux/lockdep.h:344 [inline] rcu_read_lock_sched_held+0x16c/0x1d0 kernel/rcu/update.c:118 call_timer_fn+0x177/0x700 kernel/time/timer.c:1338 trace_block_touch_buffer include/trace/events/block.h:45 [inline] touch_buffer fs/buffer.c:58 [inline] __find_get_block+0xaf6/0xde0 fs/buffer.c:1299 sb_find_get_block include/linux/buffer_head.h:346 [inline] recently_deleted fs/ext4/ialloc.c:684 [inline] find_inode_bit+0x213/0x520 fs/ext4/ialloc.c:724 __ext4_new_inode+0x160c/0x5a20 fs/ext4/ialloc.c:916 expire_timers+0x243/0x4e0 kernel/time/timer.c:1375 __run_timers kernel/time/timer.c:1696 [inline] run_timer_softirq+0x21c/0x670 kernel/time/timer.c:1709 __do_softirq+0x265/0x980 kernel/softirq.c:292 do_softirq_own_stack+0x2a/0x40 arch/x86/entry/entry_64.S:1092 ext4_symlink+0x3f5/0xc00 fs/ext4/namei.c:3176 vfs_symlink+0x453/0x6c0 fs/namei.c:4129 do_softirq.part.0+0x160/0x1c0 kernel/softirq.c:336 do_symlinkat+0x258/0x2c0 fs/namei.c:4156 do_softirq kernel/softirq.c:328 [inline] __local_bh_enable_ip+0x20e/0x270 kernel/softirq.c:189 __ipv6_dev_mc_inc+0x715/0xa80 net/ipv6/mcast.c:932 ipv6_add_dev+0xadb/0x10b0 net/ipv6/addrconf.c:456 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 addrconf_notify+0x6a3/0x21f0 net/ipv6/addrconf.c:3447 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7f8ec29b89f7 Code: 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 0a 01 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffd3b1ef758 EFLAGS: 00000202 ORIG_RAX: 000000000000010a RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f8ec29b89f7 notifier_call_chain+0xc0/0x230 kernel/notifier.c:93 RDX: 00007f8ec2a1314f RSI: 00000000ffffff9c RDI: 00007ffd3b1ef820 call_netdevice_notifiers net/core/dev.c:1762 [inline] register_netdevice+0xdd2/0x10f0 net/core/dev.c:8761 RBP: 0000000000000000 R08: 0000000000000000 R09: 00007ffd3b1ef5f0 R10: 00007ffd3b1ef4a7 R11: 0000000000000202 R12: 0000000000000001 br_dev_newlink+0x23/0x110 net/bridge/br_netlink.c:1300 R13: 0000000000000000 R14: 0000000000000001 R15: 00007ffd3b1ef820 rtnl_newlink+0x1030/0x15c0 net/core/rtnetlink.c:3141 Allocated by task 28597: kmem_cache_alloc+0x122/0x370 mm/slab.c:3559 getname_flags+0xce/0x590 fs/namei.c:140 do_sys_open+0x26c/0x520 fs/open.c:1079 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 28597: __cache_free mm/slab.c:3503 [inline] kmem_cache_free+0x7f/0x260 mm/slab.c:3765 putname+0xe1/0x120 fs/namei.c:261 do_sys_open+0x2ba/0x520 fs/open.c:1094 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8880a52ac300 which belongs to the cache names_cache of size 4096 The buggy address is located 56 bytes inside of 4096-byte region [ffff8880a52ac300, ffff8880a52ad300) The buggy address belongs to the page: page:ffffea000294ab00 count:1 mapcount:0 mapping:ffff88823b843380 index:0x0 compound_mapcount: 0 flags: 0xfff00000008100(slab|head) raw: 00fff00000008100 ffffea00027c3d88 ffffea000294ab88 ffff88823b843380 raw: 0000000000000000 ffff8880a52ac300 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a52ac200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc rtnetlink_rcv_msg+0x453/0xb80 net/core/rtnetlink.c:4782 ffff8880a52ac280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880a52ac300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ netlink_rcv_skb+0x160/0x440 net/netlink/af_netlink.c:2463 ffff8880a52ac380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a52ac400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: 48 8b ad 20 02 00 00 mov 0x220(%rbp),%rbp 7: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax e: fc ff df 11: 48 89 fa mov %rdi,%rdx 14: 48 c1 ea 03 shr $0x3,%rdx 18: 0f b6 04 02 movzbl (%rdx,%rax,1),%eax 1c: 84 c0 test %al,%al 1e: 74 04 je 0x24 20: 3c 03 cmp $0x3,%al 22: 7e 11 jle 0x35 24: 8b 83 c8 00 00 00 mov 0xc8(%rbx),%eax * 2a: 65 44 01 64 85 00 add %r12d,%gs:0x0(%rbp,%rax,4) <-- trapping instruction 30: 5b pop %rbx 31: 5d pop %rbp 32: 41 5c pop %r12 34: c3 retq 35: e8 13 8c 29 fb callq 0xfb298c4d 3a: eb e8 jmp 0x24 3c: e8 .byte 0xe8 3d: 9c pushfq 3e: 8c 29 mov %gs,(%rcx)