syzbot


KASAN: use-after-free Write in mod_timer_pending

Status: closed as invalid on 2017/10/22 12:45
First crash: 2711d, last: 2661d

Sample crash report:
9pnet_virtio: no channels available for device ./bus
netlink: 1 bytes leftover after parsing attributes in process `syz-executor0'.
==================================================================
BUG: KASAN: use-after-free in hlist_add_head include/linux/list.h:673 [inline]
BUG: KASAN: use-after-free in enqueue_timer kernel/time/timer.c:520 [inline]
BUG: KASAN: use-after-free in __mod_timer kernel/time/timer.c:1021 [inline]
BUG: KASAN: use-after-free in mod_timer_pending+0x11d5/0x14e0 kernel/time/timer.c:1045
Write of size 8 at addr ffff88019cd94408 by task syz-executor7/16990

CPU: 1 PID: 16990 Comm: syz-executor7 Not tainted 4.13.0+ #80
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __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_store8_noabort+0x17/0x20 mm/kasan/report.c:435
 hlist_add_head include/linux/list.h:673 [inline]
 enqueue_timer kernel/time/timer.c:520 [inline]
 __mod_timer kernel/time/timer.c:1021 [inline]
 mod_timer_pending+0x11d5/0x14e0 kernel/time/timer.c:1045
 tcp_check_req+0x11a5/0x1630 net/ipv4/tcp_minisocks.c:620
 tcp_v6_rcv+0x1025/0x2820 net/ipv6/tcp_ipv6.c:1465
 ip6_input_finish+0x36f/0x16d0 net/ipv6/ip6_input.c:284
 NF_HOOK include/linux/netfilter.h:249 [inline]
 ip6_input+0xe9/0x560 net/ipv6/ip6_input.c:327
 dst_input include/net/dst.h:478 [inline]
 ip6_rcv_finish+0x1a9/0x7a0 net/ipv6/ip6_input.c:71
 NF_HOOK include/linux/netfilter.h:249 [inline]
 ipv6_rcv+0xff0/0x2190 net/ipv6/ip6_input.c:208
 __netif_receive_skb_core+0x19af/0x33d0 net/core/dev.c:4423
 __netif_receive_skb+0x2c/0x1b0 net/core/dev.c:4461
 netif_receive_skb_internal+0x10b/0x670 net/core/dev.c:4534
 netif_receive_skb+0xae/0x390 net/core/dev.c:4558
 tun_rx_batched.isra.43+0x5ed/0x860 drivers/net/tun.c:1218
 tun_get_user+0x11dd/0x2150 drivers/net/tun.c:1553
 tun_chr_write_iter+0xde/0x190 drivers/net/tun.c:1579
 call_write_iter include/linux/fs.h:1743 [inline]
 new_sync_write fs/read_write.c:457 [inline]
 __vfs_write+0x68a/0x970 fs/read_write.c:470
 vfs_write+0x18f/0x510 fs/read_write.c:518
 SYSC_write fs/read_write.c:565 [inline]
 SyS_write+0xef/0x220 fs/read_write.c:557
 entry_SYSCALL_64_fastpath+0x1f/0xbe
RIP: 0033:0x40c2c1
RSP: 002b:00007f7865f50c10 EFLAGS: 00000293 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00000000007180b0 RCX: 000000000040c2c1
RDX: 000000000000004a RSI: 0000000020d85f9e RDI: 0000000000000015
RBP: 0000000000000082 R08: 0000000000000000 R09: 0000000000000000
R10: 00000000000f4240 R11: 0000000000000293 R12: 00000000004dd532
R13: 00000000ffffffff R14: 0000000000000016 R15: 0000000000000000

Allocated by task 16643:
 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_node mm/slab.c:3689 [inline]
 __kmalloc_node+0x47/0x70 mm/slab.c:3696
 kmalloc_node include/linux/slab.h:535 [inline]
 kvmalloc_node+0x64/0xd0 mm/util.c:397
 kvmalloc include/linux/mm.h:529 [inline]
 kvzalloc include/linux/mm.h:537 [inline]
 alloc_netdev_mqs+0x16e/0xed0 net/core/dev.c:8018
 tun_set_iff drivers/net/tun.c:2022 [inline]
 __tun_chr_ioctl+0x12be/0x3d20 drivers/net/tun.c:2276
 tun_chr_ioctl+0x2a/0x40 drivers/net/tun.c:2521
 vfs_ioctl fs/ioctl.c:45 [inline]
 do_vfs_ioctl+0x1b1/0x1530 fs/ioctl.c:685
 SYSC_ioctl fs/ioctl.c:700 [inline]
 SyS_ioctl+0x8f/0xc0 fs/ioctl.c:691
 entry_SYSCALL_64_fastpath+0x1f/0xbe

Freed by task 16643:
 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
 kvfree+0x36/0x60 mm/util.c:416
 netdev_freemem net/core/dev.c:7970 [inline]
 free_netdev+0x2cf/0x360 net/core/dev.c:8132
 tun_set_iff drivers/net/tun.c:2105 [inline]
 __tun_chr_ioctl+0x2cf6/0x3d20 drivers/net/tun.c:2276
 tun_chr_ioctl+0x2a/0x40 drivers/net/tun.c:2521
 vfs_ioctl fs/ioctl.c:45 [inline]
 do_vfs_ioctl+0x1b1/0x1530 fs/ioctl.c:685
 SYSC_ioctl fs/ioctl.c:700 [inline]
 SyS_ioctl+0x8f/0xc0 fs/ioctl.c:691
 entry_SYSCALL_64_fastpath+0x1f/0xbe

The buggy address belongs to the object at ffff88019cd91000
 which belongs to the cache kmalloc-16384 of size 16384
The buggy address is located 13320 bytes inside of
 16384-byte region [ffff88019cd91000, ffff88019cd95000)
The buggy address belongs to the page:
page:ffffea0006736400 count:1 mapcount:0 mapping:ffff88019cd91000 index:0x0 compound_mapcount: 0
flags: 0x200000000008100(slab|head)
raw: 0200000000008100 ffff88019cd91000 0000000000000000 0000000100000001
raw: ffffea00070b4020 ffffea000709e820 ffff8801dac02200 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88019cd94300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88019cd94380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88019cd94400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                      ^
 ffff88019cd94480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88019cd94500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (12):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2017/09/13 02:33 upstream c971aa3693e1 0bd6a0a5 .config console log report ci-upstream-kasan-gce
2017/10/16 03:00 upstream ae7df8f985f1 c26ea367 .config console log report ci-upstream-kasan-gce-386
2017/10/11 22:04 upstream 56ae414e9d27 c26ea367 .config console log report ci-upstream-kasan-gce-386
2017/10/03 19:25 upstream 887c8ba753fb c26ea367 .config console log report ci-upstream-kasan-gce-386
2017/09/26 05:07 upstream 19240e6b2a6c c26ea367 .config console log report ci-upstream-kasan-gce-386
2017/10/05 22:01 mmots fb686cb13e51 c26ea367 .config console log report ci-upstream-mmots-kasan-gce
2017/09/30 12:24 linux-next 1418b852174a c26ea367 .config console log report ci-upstream-next-kasan-gce
2017/09/29 20:10 mmots 8fd0520d9cec c26ea367 .config console log report ci-upstream-mmots-kasan-gce
2017/09/28 17:57 mmots da2915ba6bbf c26ea367 .config console log report ci-upstream-mmots-kasan-gce
2017/09/10 11:08 linux-next 58bcd35f859b d18bfda0 .config console log report skylake-linux-next-kasan-qemu
2017/09/04 23:16 linux-next 9829d9f31f6c f400a0da .config console log report skylake-linux-next-kasan-qemu
2017/08/26 23:33 linux-next 7159188b70e3 4074aed7 .config console log report ci-upstream-next-kasan-gce
* Struck through repros no longer work on HEAD.