syzbot


KASAN: use-after-free Read in dev_hard_start_xmit

Status: auto-closed as invalid on 2020/04/12 07:07
Reported-by: syzbot+74f2194e01d71c0c4069@syzkaller.appspotmail.com
First crash: 1788d, last: 1788d

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in xmit_one net/core/dev.c:3007 [inline]
BUG: KASAN: use-after-free in dev_hard_start_xmit+0x7d0/0x8b0 net/core/dev.c:3025
Read of size 4 at addr ffff888000100140 by task syz-executor.0/22177

CPU: 1 PID: 22177 Comm: syz-executor.0 Not tainted 4.14.158-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x142/0x197 lib/dump_stack.c:58
 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_load4_noabort+0x14/0x20 mm/kasan/report.c:429
 xmit_one net/core/dev.c:3007 [inline]
 dev_hard_start_xmit+0x7d0/0x8b0 net/core/dev.c:3025
 __dev_queue_xmit+0x1d95/0x25e0 net/core/dev.c:3525
 dev_queue_xmit+0x18/0x20 net/core/dev.c:3558
 packet_snd net/packet/af_packet.c:2993 [inline]
 packet_sendmsg+0x1dd4/0x5a60 net/packet/af_packet.c:3018
 sock_sendmsg_nosec net/socket.c:646 [inline]
 sock_sendmsg+0xce/0x110 net/socket.c:656
 kernel_sendmsg+0x44/0x50 net/socket.c:664
 sock_no_sendpage+0x107/0x130 net/core/sock.c:2569
 kernel_sendpage+0x92/0xf0 net/socket.c:3406
 sock_sendpage+0x8b/0xc0 net/socket.c:871
 pipe_to_sendpage+0x242/0x340 fs/splice.c:451
 splice_from_pipe_feed fs/splice.c:502 [inline]
 __splice_from_pipe+0x348/0x780 fs/splice.c:626
 splice_from_pipe+0xf0/0x150 fs/splice.c:661
 generic_splice_sendpage+0x3c/0x50 fs/splice.c:832
 do_splice_from fs/splice.c:851 [inline]
 direct_splice_actor+0x123/0x190 fs/splice.c:1018
 splice_direct_to_actor+0x29e/0x7b0 fs/splice.c:973
 do_splice_direct+0x18d/0x230 fs/splice.c:1061
 do_sendfile+0x4db/0xbd0 fs/read_write.c:1441
 SYSC_sendfile64 fs/read_write.c:1502 [inline]
 SyS_sendfile64+0x102/0x110 fs/read_write.c:1488
 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x45a909
RSP: 002b:00007f4bb97b8c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 000000000045a909
RDX: 0000000000000000 RSI: 0000000000000005 RDI: 0000000000000004
RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000
R10: 00000ffffffff000 R11: 0000000000000246 R12: 00007f4bb97b96d4
R13: 00000000004c9270 R14: 00000000004e0e50 R15: 00000000ffffffff

Allocated by task 22177:
 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
 kasan_slab_alloc+0xf/0x20 mm/kasan/kasan.c:489
 kmem_cache_alloc+0x12e/0x780 mm/slab.c:3552
 skb_clone+0x129/0x320 net/core/skbuff.c:1282
 dev_queue_xmit_nit+0x2da/0x940 net/core/dev.c:1943
 xmit_one net/core/dev.c:3005 [inline]
 dev_hard_start_xmit+0xa7/0x8b0 net/core/dev.c:3025
 __dev_queue_xmit+0x1d95/0x25e0 net/core/dev.c:3525
 dev_queue_xmit+0x18/0x20 net/core/dev.c:3558
 packet_snd net/packet/af_packet.c:2993 [inline]
 packet_sendmsg+0x1dd4/0x5a60 net/packet/af_packet.c:3018
 sock_sendmsg_nosec net/socket.c:646 [inline]
 sock_sendmsg+0xce/0x110 net/socket.c:656
 kernel_sendmsg+0x44/0x50 net/socket.c:664
 sock_no_sendpage+0x107/0x130 net/core/sock.c:2569
 kernel_sendpage+0x92/0xf0 net/socket.c:3406
 sock_sendpage+0x8b/0xc0 net/socket.c:871
 pipe_to_sendpage+0x242/0x340 fs/splice.c:451
 splice_from_pipe_feed fs/splice.c:502 [inline]
 __splice_from_pipe+0x348/0x780 fs/splice.c:626
 splice_from_pipe+0xf0/0x150 fs/splice.c:661
 generic_splice_sendpage+0x3c/0x50 fs/splice.c:832
 do_splice_from fs/splice.c:851 [inline]
 direct_splice_actor+0x123/0x190 fs/splice.c:1018
 splice_direct_to_actor+0x29e/0x7b0 fs/splice.c:973
 do_splice_direct+0x18d/0x230 fs/splice.c:1061
 do_sendfile+0x4db/0xbd0 fs/read_write.c:1441
 SYSC_sendfile64 fs/read_write.c:1502 [inline]
 SyS_sendfile64+0x102/0x110 fs/read_write.c:1488
 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7

Freed by task 22177:
 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]
 kmem_cache_free+0x83/0x2b0 mm/slab.c:3758
 kfree_skbmem+0xa5/0x110 net/core/skbuff.c:586
 __kfree_skb net/core/skbuff.c:646 [inline]
 consume_skb+0xb7/0x340 net/core/skbuff.c:705
 packet_rcv+0xe0/0x1330 net/packet/af_packet.c:2178
 dev_queue_xmit_nit+0x6d8/0x940 net/core/dev.c:1975
 xmit_one net/core/dev.c:3005 [inline]
 dev_hard_start_xmit+0xa7/0x8b0 net/core/dev.c:3025
 __dev_queue_xmit+0x1d95/0x25e0 net/core/dev.c:3525
 dev_queue_xmit+0x18/0x20 net/core/dev.c:3558
 packet_snd net/packet/af_packet.c:2993 [inline]
 packet_sendmsg+0x1dd4/0x5a60 net/packet/af_packet.c:3018
 sock_sendmsg_nosec net/socket.c:646 [inline]
 sock_sendmsg+0xce/0x110 net/socket.c:656
 kernel_sendmsg+0x44/0x50 net/socket.c:664
 sock_no_sendpage+0x107/0x130 net/core/sock.c:2569
 kernel_sendpage+0x92/0xf0 net/socket.c:3406
 sock_sendpage+0x8b/0xc0 net/socket.c:871
 pipe_to_sendpage+0x242/0x340 fs/splice.c:451
 splice_from_pipe_feed fs/splice.c:502 [inline]
 __splice_from_pipe+0x348/0x780 fs/splice.c:626
 splice_from_pipe+0xf0/0x150 fs/splice.c:661
 generic_splice_sendpage+0x3c/0x50 fs/splice.c:832
 do_splice_from fs/splice.c:851 [inline]
 direct_splice_actor+0x123/0x190 fs/splice.c:1018
 splice_direct_to_actor+0x29e/0x7b0 fs/splice.c:973
 do_splice_direct+0x18d/0x230 fs/splice.c:1061
 do_sendfile+0x4db/0xbd0 fs/read_write.c:1441
 SYSC_sendfile64 fs/read_write.c:1502 [inline]
 SyS_sendfile64+0x102/0x110 fs/read_write.c:1488
 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7

The buggy address belongs to the object at ffff8880001000c0
 which belongs to the cache skbuff_head_cache of size 232
The buggy address is located 128 bytes inside of
 232-byte region [ffff8880001000c0, ffff8880001001a8)
The buggy address belongs to the page:
page:ffffea0000004000 count:1 mapcount:0 mapping:ffff8880001000c0 index:0x0
flags: 0x7ffe0000000100(slab)
raw: 007ffe0000000100 ffff8880001000c0 0000000000000000 000000010000000c
raw: ffffea0001bb8320 ffff8880a9e83048 ffff8880a9ee3c00 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff888000100000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888000100080: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
>ffff888000100100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
protocol 88fb is buggy, dev hsr_slave_0
                                           ^
protocol 88fb is buggy, dev hsr_slave_1
 ffff888000100180: fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc
 ffff888000100200: 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/12/14 07:06 linux-4.14.y a844dc4c5442 eef6e580 .config console log report ci2-linux-4-14
* Struck through repros no longer work on HEAD.