syzbot


KASAN: use-after-free Read in dev_queue_xmit_nit

Status: auto-closed as invalid on 2020/02/08 07:01
Reported-by: syzbot+0c52cd816b9faf3571e4@syzkaller.appspotmail.com
First crash: 1102d, last: 992d
similar bugs (6):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-414 KASAN: use-after-free Read in dev_queue_xmit_nit 1 959d 959d 0/1 auto-closed as invalid on 2020/03/12 11:34
upstream KASAN: use-after-free Read in dev_queue_xmit_nit (3) 3 1377d 1387d 0/22 closed as invalid on 2018/12/05 17:50
upstream KASAN: use-after-free Read in dev_queue_xmit_nit (2) syz 2 1678d 1680d 0/22 closed as invalid on 2018/01/22 17:57
linux-4.19 KASAN: use-after-free Read in dev_queue_xmit_nit C error 68 3d11h 981d 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 1738d 1750d 3/22 fixed on 2017/11/06 08:47
linux-4.14 KASAN: use-after-free Read in dev_queue_xmit_nit (2) syz error 16 141d 757d 0/1 upstream: reported syz repro on 2020/06/02 08:57

Sample crash report:
==================================================================
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+0x7cb/0x940 net/core/dev.c:1929
Read of size 8 at addr ffff8880653879e8 by task syz-executor.2/16913

CPU: 0 PID: 16913 Comm: syz-executor.2 Not tainted 4.14.148 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 <IRQ>
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x138/0x197 lib/dump_stack.c:53
 print_address_description.cold+0x7c/0x1dc mm/kasan/report.c:252
 kasan_report_error mm/kasan/report.c:351 [inline]
 kasan_report mm/kasan/report.c:409 [inline]
 kasan_report.cold+0xa9/0x2af mm/kasan/report.c:393
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:430
 __read_once_size include/linux/compiler.h:183 [inline]
 dev_queue_xmit_nit+0x7cb/0x940 net/core/dev.c:1929
 xmit_one net/core/dev.c:3005 [inline]
 dev_hard_start_xmit+0xa7/0x8b0 net/core/dev.c:3025
 sch_direct_xmit+0x27a/0x550 net/sched/sch_generic.c:186
 __dev_xmit_skb net/core/dev.c:3218 [inline]
 __dev_queue_xmit+0x1b6e/0x25e0 net/core/dev.c:3493
 dev_queue_xmit+0x18/0x20 net/core/dev.c:3558
 neigh_hh_output include/net/neighbour.h:490 [inline]
 neigh_output include/net/neighbour.h:498 [inline]
 ip6_finish_output2+0x10bd/0x21b0 net/ipv6/ip6_output.c:120
 ip6_finish_output+0x4f4/0xb50 net/ipv6/ip6_output.c:154
 NF_HOOK_COND include/linux/netfilter.h:239 [inline]
 ip6_output+0x20f/0x6d0 net/ipv6/ip6_output.c:171
 dst_output include/net/dst.h:462 [inline]
 NF_HOOK include/linux/netfilter.h:250 [inline]
 NF_HOOK include/linux/netfilter.h:244 [inline]
 mld_sendpack+0x8d1/0xd60 net/ipv6/mcast.c:1660
 mld_send_cr net/ipv6/mcast.c:1956 [inline]
 mld_ifc_timer_expire+0x3b6/0x7b0 net/ipv6/mcast.c:2455
 call_timer_fn+0x161/0x670 kernel/time/timer.c:1279
 expire_timers kernel/time/timer.c:1318 [inline]
 __run_timers kernel/time/timer.c:1634 [inline]
 __run_timers kernel/time/timer.c:1602 [inline]
 run_timer_softirq+0x5b4/0x1570 kernel/time/timer.c:1647
 __do_softirq+0x244/0x9a0 kernel/softirq.c:288
 invoke_softirq kernel/softirq.c:368 [inline]
 irq_exit+0x160/0x1b0 kernel/softirq.c:409
 exiting_irq arch/x86/include/asm/apic.h:648 [inline]
 smp_apic_timer_interrupt+0x146/0x5e0 arch/x86/kernel/apic/apic.c:1102
 apic_timer_interrupt+0x96/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+0x95/0xe0 kernel/locking/spinlock.c:192
RSP: 0018:ffff8880a5c36ec8 EFLAGS: 00000286 ORIG_RAX: ffffffffffffff10
RAX: 1ffffffff0ee2a81 RBX: 0000000000000286 RCX: 1ffff1100cb755bc
RDX: dffffc0000000000 RSI: ffff888065baade8 RDI: 0000000000000286
RBP: ffff8880a5c36ed8 R08: ffff888065baa540 R09: ffff888065baade0
R10: 0000000000000000 R11: 0000000000000000 R12: ffffffff87792ea0
R13: 0000000000000286 R14: ffffffff87791b10 R15: dffffc0000000000
 swake_up+0x4d/0x60 kernel/sched/swait.c:39
 __rcu_report_exp_rnp+0x1d8/0x270 kernel/rcu/tree_exp.h:185
 rcu_report_exp_rnp kernel/rcu/tree_exp.h:210 [inline]
 rcu_read_unlock_special+0x660/0xd40 kernel/rcu/tree_plugin.h:540
 __rcu_read_unlock+0x161/0x170 kernel/rcu/update.c:260
 rcu_read_unlock include/linux/rcupdate.h:684 [inline]
 net_generic include/net/netns/generic.h:47 [inline]
 caif_device_list net/caif/caif_dev.c:69 [inline]
 caif_device_notify+0x2c8/0xfd3 net/caif/caif_dev.c:369
 notifier_call_chain+0x111/0x1b0 kernel/notifier.c:93
 __raw_notifier_call_chain kernel/notifier.c:394 [inline]
 raw_notifier_call_chain+0x2e/0x40 kernel/notifier.c:401
 call_netdevice_notifiers_info+0x56/0x70 net/core/dev.c:1671
 netdev_state_change net/core/dev.c:1318 [inline]
 netdev_state_change+0xbf/0xe0 net/core/dev.c:1312
 do_setlink+0x2415/0x2d50 net/core/rtnetlink.c:2259
 rtnl_group_changelink net/core/rtnetlink.c:2482 [inline]
 rtnl_newlink+0xbe4/0x1700 net/core/rtnetlink.c:2636
 rtnetlink_rcv_msg+0x3eb/0xb70 net/core/rtnetlink.c:4285
 netlink_rcv_skb+0x14f/0x3c0 net/netlink/af_netlink.c:2432
 rtnetlink_rcv+0x1d/0x30 net/core/rtnetlink.c:4297
 netlink_unicast_kernel net/netlink/af_netlink.c:1286 [inline]
 netlink_unicast+0x45d/0x640 net/netlink/af_netlink.c:1312
 netlink_sendmsg+0x7c4/0xc60 net/netlink/af_netlink.c:1877
 sock_sendmsg_nosec net/socket.c:646 [inline]
 sock_sendmsg+0xce/0x110 net/socket.c:656
 ___sys_sendmsg+0x70a/0x840 net/socket.c:2062
 __sys_sendmsg+0xb9/0x140 net/socket.c:2096
 SYSC_sendmsg net/socket.c:2107 [inline]
 SyS_sendmsg+0x2d/0x50 net/socket.c:2103
 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x459a59
RSP: 002b:00007f628d4f6c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000459a59
RDX: 000000000400c094 RSI: 0000000020000140 RDI: 0000000000000004
RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f628d4f76d4
R13: 00000000004c7bd7 R14: 00000000004dd968 R15: 00000000ffffffff

Allocated by task 16912:
 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
 save_stack+0x45/0xd0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc mm/kasan/kasan.c:551 [inline]
 kasan_kmalloc+0xce/0xf0 mm/kasan/kasan.c:529
 __do_kmalloc mm/slab.c:3720 [inline]
 __kmalloc+0x15d/0x7a0 mm/slab.c:3729
 kmalloc include/linux/slab.h:493 [inline]
 sk_prot_alloc+0x171/0x2a0 net/core/sock.c:1467
 sk_alloc+0x39/0xd70 net/core/sock.c:1521
 packet_create+0xfa/0x820 net/packet/af_packet.c:3264
 __sock_create+0x2f6/0x620 net/socket.c:1275
 sock_create net/socket.c:1315 [inline]
 SYSC_socket net/socket.c:1345 [inline]
 SyS_socket+0xd3/0x170 net/socket.c:1325
 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7

Freed by task 16907:
 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
 save_stack+0x45/0xd0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_slab_free+0x75/0xc0 mm/kasan/kasan.c:524
 __cache_free mm/slab.c:3496 [inline]
 kfree+0xcc/0x270 mm/slab.c:3815
 sk_prot_free net/core/sock.c:1504 [inline]
 __sk_destruct+0x450/0x580 net/core/sock.c:1581
 sk_destruct+0xa4/0xd0 net/core/sock.c:1596
 __sk_free+0x54/0x230 net/core/sock.c:1604
 sk_free+0x35/0x40 net/core/sock.c:1615
 sock_put include/net/sock.h:1653 [inline]
 packet_release+0x8ba/0xb50 net/packet/af_packet.c:3093
 __sock_release+0xce/0x2b0 net/socket.c:602
 sock_close+0x1b/0x30 net/socket.c:1139
 __fput+0x275/0x7a0 fs/file_table.c:210
 ____fput+0x16/0x20 fs/file_table.c:244
 task_work_run+0x114/0x190 kernel/task_work.c:113
 tracehook_notify_resume include/linux/tracehook.h:191 [inline]
 exit_to_usermode_loop+0x1da/0x220 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+0x4bc/0x640 arch/x86/entry/common.c:297
 entry_SYSCALL_64_after_hwframe+0x42/0xb7

The buggy address belongs to the object at ffff888065387200
 which belongs to the cache kmalloc-2048 of size 2048
The buggy address is located 2024 bytes inside of
 2048-byte region [ffff888065387200, ffff888065387a00)
The buggy address belongs to the page:
page:ffffea000194e180 count:1 mapcount:0 mapping:ffff888065386100 index:0x0 compound_mapcount: 0
flags: 0x1fffc0000008100(slab|head)
raw: 01fffc0000008100 ffff888065386100 0000000000000000 0000000100000003
raw: ffffea00019410a0 ffffea000181d3a0 ffff8880aa800c40 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff888065387880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888065387900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888065387980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                          ^
 ffff888065387a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888065387a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (5):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-linux-4-14 2019/10/11 07:00 linux-4.14.y 42327896f194 1a3bad90 .config log report
ci2-linux-4-14 2019/10/10 14:48 linux-4.14.y 42327896f194 d52eff28 .config log report
ci2-linux-4-14 2019/08/11 17:33 linux-4.14.y 3ffe1e79c174 acb51638 .config log report
ci2-linux-4-14 2019/08/06 13:49 linux-4.14.y 7d80e1218adf da562c0b .config log report
ci2-linux-4-14 2019/06/22 22:16 linux-4.14.y a5758c531177 34bf9440 .config log report