syzbot


KASAN: use-after-free Read in dev_queue_xmit_nit

Status: auto-closed as invalid on 2020/03/12 11:34
Reported-by: syzbot+cfe368344d1c62b74911@syzkaller.appspotmail.com
First crash: 1835d, last: 1835d
Similar bugs (6)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in dev_queue_xmit_nit (3) net 3 2252d 2263d 0/28 closed as invalid on 2018/12/05 17:50
upstream KASAN: use-after-free Read in dev_queue_xmit_nit (2) net syz 2 2554d 2556d 0/28 closed as invalid on 2018/01/22 17:57
linux-4.19 KASAN: use-after-free Read in dev_queue_xmit_nit C error 90 655d 1856d 0/1 upstream: reported C repro on 2019/10/22 19:23
upstream KASAN: use-after-free Read in dev_queue_xmit_nit C 13 2614d 2626d 3/28 fixed on 2017/11/06 08:47
linux-4.14 KASAN: use-after-free Read in dev_queue_xmit_nit (2) syz error 18 842d 1633d 0/1 upstream: reported syz repro on 2020/06/02 08:57
linux-4.14 KASAN: use-after-free Read in dev_queue_xmit_nit 5 1868d 1978d 0/1 auto-closed as invalid on 2020/02/08 07:01

Sample crash report:
device lo left promiscuous mode
==================================================================
BUG: KASAN: use-after-free in __read_once_size include/linux/compiler.h:183 [inline]
BUG: KASAN: use-after-free in dev_queue_xmit_nit+0x7d2/0x970 net/core/dev.c:1929
Read of size 8 at addr ffff8881c900d468 by task syz-executor.2/11585

CPU: 0 PID: 11585 Comm: syz-executor.2 Not tainted 4.14.153+ #0
Call Trace:
 <IRQ>
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0xca/0x134 lib/dump_stack.c:53
 print_address_description+0x60/0x226 mm/kasan/report.c:187
 __kasan_report.cold+0x1a/0x41 mm/kasan/report.c:316
 __read_once_size include/linux/compiler.h:183 [inline]
 dev_queue_xmit_nit+0x7d2/0x970 net/core/dev.c:1929
 xmit_one net/core/dev.c:3005 [inline]
 dev_hard_start_xmit+0xa3/0x8c0 net/core/dev.c:3025
 __dev_queue_xmit+0x11e0/0x1d00 net/core/dev.c:3525
 neigh_output include/net/neighbour.h:500 [inline]
 ip6_finish_output2+0x1018/0x1fa0 net/ipv6/ip6_output.c:120
 ip6_finish_output+0x64b/0xb40 net/ipv6/ip6_output.c:154
 NF_HOOK_COND include/linux/netfilter.h:239 [inline]
 ip6_output+0x1dc/0x680 net/ipv6/ip6_output.c:171
 dst_output include/net/dst.h:462 [inline]
 NF_HOOK include/linux/netfilter.h:250 [inline]
 ndisc_send_skb+0xeb8/0x1400 net/ipv6/ndisc.c:484
 ndisc_send_rs+0x123/0x660 net/ipv6/ndisc.c:678
 addrconf_rs_timer+0x290/0x5c0 net/ipv6/addrconf.c:3784
 call_timer_fn+0x15b/0x6a0 kernel/time/timer.c:1279
 expire_timers+0x227/0x4c0 kernel/time/timer.c:1318
 __run_timers kernel/time/timer.c:1636 [inline]
 run_timer_softirq+0x1eb/0x5d0 kernel/time/timer.c:1649
 __do_softirq+0x234/0x9ec kernel/softirq.c:288
 invoke_softirq kernel/softirq.c:368 [inline]
 irq_exit+0x114/0x150 kernel/softirq.c:409
 exiting_irq arch/x86/include/asm/apic.h:648 [inline]
 smp_apic_timer_interrupt+0x1a7/0x650 arch/x86/kernel/apic/apic.c:1102
 apic_timer_interrupt+0x8c/0xa0 arch/x86/entry/entry_64.S:792
 </IRQ>
RIP: 0010:arch_local_irq_restore arch/x86/include/asm/paravirt.h:779 [inline]
RIP: 0010:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:160 [inline]
RIP: 0010:_raw_spin_unlock_irqrestore+0x59/0x70 kernel/locking/spinlock.c:192
RSP: 0018:ffff88819df36b00 EFLAGS: 00000296 ORIG_RAX: ffffffffffffff10
RAX: 0000000000000007 RBX: 0000000000000296 RCX: 1ffff1103b4593ff
RDX: 0000000000000000 RSI: ffff8881da2ca000 RDI: 0000000000000296
RBP: ffffffffb60d7140 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: ffff8881da2c9b20 R14: ffff8881a2e39b10 R15: ffffffffb60d71e8
 rcu_read_unlock_special+0x6ed/0xab0 kernel/rcu/tree_plugin.h:528
 __rcu_read_unlock+0x158/0x160 kernel/rcu/update.c:260
 rcu_read_unlock include/linux/rcupdate.h:684 [inline]
 __is_insn_slot_addr+0x113/0x1e0 kernel/kprobes.c:301
 is_kprobe_insn_slot include/linux/kprobes.h:318 [inline]
 kernel_text_address+0xfe/0x120 kernel/extable.c:148
 __kernel_text_address+0x9/0x30 kernel/extable.c:105
 unwind_get_return_address arch/x86/kernel/unwind_orc.c:255 [inline]
 unwind_get_return_address+0x51/0x90 arch/x86/kernel/unwind_orc.c:250
 __save_stack_trace+0x8a/0xf0 arch/x86/kernel/stacktrace.c:45
 save_stack mm/kasan/common.c:76 [inline]
 set_track mm/kasan/common.c:85 [inline]
 __kasan_kmalloc.part.0+0x53/0xc0 mm/kasan/common.c:501
 slab_post_alloc_hook mm/slab.h:439 [inline]
 slab_alloc_node mm/slub.c:2792 [inline]
 slab_alloc mm/slub.c:2800 [inline]
 __kmalloc_track_caller+0x10d/0x390 mm/slub.c:4367
 __kmalloc_reserve.isra.0+0x2d/0xc0 net/core/skbuff.c:137
 __alloc_skb+0x118/0x5c0 net/core/skbuff.c:205
 alloc_skb include/linux/skbuff.h:980 [inline]
 kobject_uevent_env+0x6d7/0xc60 lib/kobject_uevent.c:479
 rx_queue_add_kobject net/core/net-sysfs.c:930 [inline]
 net_rx_queue_update_kobjects+0x10e/0x400 net/core/net-sysfs.c:948
 register_queue_kobjects net/core/net-sysfs.c:1392 [inline]
 netdev_register_kobject+0x20f/0x31c net/core/net-sysfs.c:1603
 register_netdevice+0x83d/0xc90 net/core/dev.c:7668
 ip_tunnel_newlink+0x368/0x830 net/ipv4/ip_tunnel.c:1107
 vti_newlink+0xae/0xf0 net/ipv4/ip_vti.c:555
 rtnl_newlink+0xed3/0x16b0 net/core/rtnetlink.c:2698
 rtnetlink_rcv_msg+0x3d3/0xb40 net/core/rtnetlink.c:4285
 netlink_rcv_skb+0x137/0x3a0 net/netlink/af_netlink.c:2432
 netlink_unicast_kernel net/netlink/af_netlink.c:1286 [inline]
 netlink_unicast+0x478/0x650 net/netlink/af_netlink.c:1312
 netlink_sendmsg+0x66a/0xbe0 net/netlink/af_netlink.c:1877
 sock_sendmsg_nosec net/socket.c:646 [inline]
 sock_sendmsg+0xb7/0x100 net/socket.c:656
 ___sys_sendmsg+0x752/0x890 net/socket.c:2062
 __sys_sendmsg+0xb6/0x150 net/socket.c:2096
 SYSC_sendmsg net/socket.c:2107 [inline]
 SyS_sendmsg+0x27/0x40 net/socket.c:2103
 do_syscall_64+0x19b/0x520 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x45a219
RSP: 002b:00007f1de8041c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 000000000045a219
RDX: 0000000000000000 RSI: 0000000020000040 RDI: 0000000000000006
RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f1de80426d4
R13: 00000000004c875f R14: 00000000004ded58 R15: 00000000ffffffff

Allocated by task 11573:
 save_stack mm/kasan/common.c:76 [inline]
 set_track mm/kasan/common.c:85 [inline]
 __kasan_kmalloc.part.0+0x53/0xc0 mm/kasan/common.c:501
 kmalloc include/linux/slab.h:493 [inline]
 sk_prot_alloc+0x20e/0x2d0 net/core/sock.c:1467
 sk_alloc+0x36/0x620 net/core/sock.c:1521
 packet_create+0xf5/0x7e0 net/packet/af_packet.c:3264
 __sock_create+0x2f7/0x620 net/socket.c:1275
 sock_create net/socket.c:1315 [inline]
 SYSC_socket net/socket.c:1345 [inline]
 SyS_socket+0xe1/0x1e0 net/socket.c:1325
 do_syscall_64+0x19b/0x520 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7
 0xffffffffffffffff

Freed by task 11568:
 save_stack mm/kasan/common.c:76 [inline]
 set_track mm/kasan/common.c:85 [inline]
 __kasan_slab_free+0x164/0x210 mm/kasan/common.c:463
 slab_free_hook mm/slub.c:1407 [inline]
 slab_free_freelist_hook mm/slub.c:1458 [inline]
 slab_free mm/slub.c:3039 [inline]
 kfree+0x108/0x3a0 mm/slub.c:3976
 sk_prot_free net/core/sock.c:1504 [inline]
 __sk_destruct+0x40c/0x5a0 net/core/sock.c:1581
 sk_destruct+0x97/0xc0 net/core/sock.c:1596
 __sk_free+0x4c/0x220 net/core/sock.c:1604
 sk_free+0x2c/0x40 net/core/sock.c:1615
 sock_put include/net/sock.h:1653 [inline]
 packet_release+0x8da/0xb80 net/packet/af_packet.c:3093
 __sock_release+0xd2/0x2c0 net/socket.c:602
 sock_close+0x15/0x20 net/socket.c:1139
 __fput+0x25e/0x710 fs/file_table.c:210
 task_work_run+0x125/0x1a0 kernel/task_work.c:113
 tracehook_notify_resume include/linux/tracehook.h:191 [inline]
 exit_to_usermode_loop+0x13b/0x160 arch/x86/entry/common.c:164
 prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline]
 syscall_return_slowpath arch/x86/entry/common.c:270 [inline]
 do_syscall_64+0x3a3/0x520 arch/x86/entry/common.c:297
 entry_SYSCALL_64_after_hwframe+0x42/0xb7
 0xffffffffffffffff

The buggy address belongs to the object at ffff8881c900cc80
 which belongs to the cache kmalloc-2048 of size 2048
The buggy address is located 2024 bytes inside of
 2048-byte region [ffff8881c900cc80, ffff8881c900d480)
The buggy address belongs to the page:
page:ffffea0007240200 count:1 mapcount:0 mapping:          (null) index:0x0 compound_mapcount: 0
flags: 0x4000000000010200(slab|head)
raw: 4000000000010200 0000000000000000 0000000000000000 00000001000f000f
raw: 0000000000000000 0000000100000001 ffff8881da802800 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8881c900d300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8881c900d380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8881c900d400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                          ^
 ffff8881c900d480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8881c900d500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/11/13 11:33 android-4.14 0ac69147fd8c 048f2d49 .config console log report ci-android-414-kasan-gce-root
* Struck through repros no longer work on HEAD.