syzbot


KASAN: use-after-free Read in fanout_demux_rollover

Status: closed as invalid on 2017/10/18 08:55
First crash: 2359d, last: 2341d
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-49 KASAN: use-after-free Read in fanout_demux_rollover C 5 2341d 2362d 1/3 fixed on 2017/11/06 20:46

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in fanout_demux_rollover+0x49b/0x4d0 net/packet/af_packet.c:1392
Read of size 8 at addr ffff8801d3557c30 by task syzkaller133442/10027

CPU: 1 PID: 10027 Comm: syzkaller133442 Not tainted 4.13.0+ #79
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 <IRQ>
 __dump_stack lib/dump_stack.c:16 [inline]
 dump_stack+0x194/0x257 lib/dump_stack.c:52
 print_address_description+0x73/0x250 mm/kasan/report.c:252
 kasan_report_error mm/kasan/report.c:351 [inline]
 kasan_report+0x24e/0x340 mm/kasan/report.c:409
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:430
 fanout_demux_rollover+0x49b/0x4d0 net/packet/af_packet.c:1392
 packet_rcv_fanout+0x52e/0x7d0 net/packet/af_packet.c:1478
 deliver_skb net/core/dev.c:1859 [inline]
 deliver_ptype_list_skb net/core/dev.c:1874 [inline]
 __netif_receive_skb_core+0xc12/0x33d0 net/core/dev.c:4406
 __netif_receive_skb+0x2c/0x1b0 net/core/dev.c:4461
 netif_receive_skb_internal+0x10b/0x670 net/core/dev.c:4534
 napi_skb_finish net/core/dev.c:4895 [inline]
 napi_gro_receive+0x3d0/0x500 net/core/dev.c:4926
 receive_buf+0xcc5/0x51f0 drivers/net/virtio_net.c:841
 virtnet_receive drivers/net/virtio_net.c:1087 [inline]
 virtnet_poll+0x304/0xad0 drivers/net/virtio_net.c:1168
 napi_poll net/core/dev.c:5537 [inline]
 net_rx_action+0x792/0x1910 net/core/dev.c:5603
 __do_softirq+0x2bb/0xbd0 kernel/softirq.c:284
 invoke_softirq kernel/softirq.c:364 [inline]
 irq_exit+0x1d3/0x210 kernel/softirq.c:405
 exiting_irq arch/x86/include/asm/apic.h:638 [inline]
 do_IRQ+0xf6/0x190 arch/x86/kernel/irq.c:253
 common_interrupt+0x9d/0x9d arch/x86/entry/entry_64.S:598
 </IRQ>
RIP: 0010:arch_local_irq_enable arch/x86/include/asm/paravirt.h:824 [inline]
RIP: 0010:__raw_spin_unlock_irq include/linux/spinlock_api_smp.h:168 [inline]
RIP: 0010:_raw_spin_unlock_irq+0x56/0x70 kernel/locking/spinlock.c:199
RSP: 0018:ffff8801d4357950 EFLAGS: 00000282 ORIG_RAX: ffffffffffffff1e
RAX: dffffc0000000000 RBX: ffff8801d8c54c50 RCX: 0000000000000000
RDX: 1ffffffff0b592ff RSI: 0000000000000001 RDI: ffffffff85ac97f8
RBP: ffff8801d4357958 R08: ffff8801d43572b8 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: dffffc0000000000
R13: ffffed003a86af35 R14: 0000000000000000 R15: ffffffff86488ba0
 task_work_run+0x16c/0x270 kernel/task_work.c:105
 exit_task_work include/linux/task_work.h:21 [inline]
 do_exit+0xa52/0x1b40 kernel/exit.c:865
 do_group_exit+0x149/0x400 kernel/exit.c:968
 SYSC_exit_group kernel/exit.c:979 [inline]
 SyS_exit_group+0x1d/0x20 kernel/exit.c:977
 entry_SYSCALL_64_fastpath+0x1f/0xbe
RIP: 0033:0x44a769
RSP: 002b:00007ffea08ab338 EFLAGS: 00000202 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 000000000000000b RCX: 000000000044a769
RDX: 0000000000448f81 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000082 R08: 00000000006dcbc0 R09: 0000000000000000
R10: 00000000006dcb44 R11: 0000000000000202 R12: 0000000000000000
R13: 00007ffea08ab2df R14: 00007fa7ee2999c0 R15: 0000000000000000

Allocated by task 10083:
 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
 save_stack+0x43/0xd0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:551
 __do_kmalloc mm/slab.c:3725 [inline]
 __kmalloc+0x162/0x760 mm/slab.c:3734
 kmalloc include/linux/slab.h:498 [inline]
 sk_prot_alloc+0x101/0x2a0 net/core/sock.c:1469
 sk_alloc+0x89/0x700 net/core/sock.c:1525
 packet_create+0x169/0xb00 net/packet/af_packet.c:3211
 __sock_create+0x4d4/0x850 net/socket.c:1262
 sock_create net/socket.c:1302 [inline]
 SYSC_socket net/socket.c:1332 [inline]
 SyS_socket+0xeb/0x200 net/socket.c:1312
 entry_SYSCALL_64_fastpath+0x1f/0xbe

Freed by task 10023:
 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
 save_stack+0x43/0xd0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_slab_free+0x71/0xc0 mm/kasan/kasan.c:524
 __cache_free mm/slab.c:3503 [inline]
 kfree+0xca/0x250 mm/slab.c:3820
 sk_prot_free net/core/sock.c:1508 [inline]
 __sk_destruct+0x74a/0x910 net/core/sock.c:1587
 sk_destruct+0x47/0x80 net/core/sock.c:1595
 __sk_free+0x57/0x230 net/core/sock.c:1603
 sk_free+0x2a/0x40 net/core/sock.c:1614
 sock_put include/net/sock.h:1649 [inline]
 packet_release+0x859/0xd70 net/packet/af_packet.c:3047
 sock_release+0x8d/0x1e0 net/socket.c:597
 sock_close+0x16/0x20 net/socket.c:1126
 __fput+0x333/0x7f0 fs/file_table.c:210
 ____fput+0x15/0x20 fs/file_table.c:246
 task_work_run+0x199/0x270 kernel/task_work.c:112
 exit_task_work include/linux/task_work.h:21 [inline]
 do_exit+0xa52/0x1b40 kernel/exit.c:865
 do_group_exit+0x149/0x400 kernel/exit.c:968
 SYSC_exit_group kernel/exit.c:979 [inline]
 SyS_exit_group+0x1d/0x20 kernel/exit.c:977
 entry_SYSCALL_64_fastpath+0x1f/0xbe

The buggy address belongs to the object at ffff8801d35574c0
 which belongs to the cache kmalloc-2048 of size 2048
The buggy address is located 1904 bytes inside of
 2048-byte region [ffff8801d35574c0, ffff8801d3557cc0)
The buggy address belongs to the page:
page:ffffea00074d5580 count:1 mapcount:0 mapping:ffff8801d35563c0 index:0x0 compound_mapcount: 0
flags: 0x200000000008100(slab|head)

Crashes (10):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2017/09/12 02:34 upstream f007cad159e9 449b6f15 .config console log report syz C ci-upstream-kasan-gce
2017/09/20 10:39 net-next-old 8ca712c373a4 4e341009 .config console log report syz C ci-upstream-net-kasan-gce
2017/09/13 13:50 net-next-old ad9a19d00370 96b8e399 .config console log report syz C ci-upstream-net-kasan-gce
2017/09/07 19:19 net-next-old 80cee03bf1d6 d18bfda0 .config console log report syz C ci-upstream-net-kasan-gce
2017/09/20 10:38 linux-next 0b093a564fe0 4e341009 .config console log report syz C ci-upstream-next-kasan-gce
2017/09/12 02:30 linux-next a31cc455c512 449b6f15 .config console log report syz C ci-upstream-next-kasan-gce
2017/09/12 02:19 linux-next a31cc455c512 449b6f15 .config console log report syz C ci-upstream-next-kasan-gce
2017/09/07 19:41 linux-next c6be5a0e3ceb 0ed1da4a .config console log report syz C skylake-linux-next-kasan-qemu
2017/09/26 00:33 mmots 720bbe532b7c c26ea367 .config console log report syz ci-upstream-mmots-kasan-gce
2017/09/19 15:39 mmots 720bbe532b7c c26ea367 .config console log report syz ci-upstream-mmots-kasan-gce
* Struck through repros no longer work on HEAD.