syzbot


KASAN: use-after-free Read in bpf_clone_redirect

Status: auto-closed as invalid on 2020/03/20 16:38
Reported-by: syzbot+41771c29517985192f14@syzkaller.appspotmail.com
First crash: 1925d, last: 1828d
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-414 KASAN: use-after-free Read in bpf_clone_redirect C 30 1828d 2052d 0/1 public: reported C repro on 2019/04/12 00:00

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in ____bpf_clone_redirect net/core/filter.c:1768 [inline]
BUG: KASAN: use-after-free in bpf_clone_redirect+0x2de/0x2f0 net/core/filter.c:1759
Read of size 8 at addr ffff888094305290 by task syz-executor.1/19615

CPU: 1 PID: 19615 Comm: syz-executor.1 Not tainted 4.14.155-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_load8_noabort+0x14/0x20 mm/kasan/report.c:430
 ____bpf_clone_redirect net/core/filter.c:1768 [inline]
 bpf_clone_redirect+0x2de/0x2f0 net/core/filter.c:1759
 bpf_prog_3c8dfff8b3098609+0x7df/0x1000

Allocated by task 11515:
 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
 skb_share_check include/linux/skbuff.h:1554 [inline]
 packet_rcv_spkt+0x424/0x560 net/packet/af_packet.c:1857
 deliver_skb net/core/dev.c:1881 [inline]
 deliver_ptype_list_skb net/core/dev.c:1896 [inline]
 __netif_receive_skb_core+0x9ef/0x2ca0 net/core/dev.c:4460
 __netif_receive_skb+0x2c/0x1b0 net/core/dev.c:4515
 netif_receive_skb_internal+0xe4/0x5a0 net/core/dev.c:4588
 napi_skb_finish net/core/dev.c:4949 [inline]
 napi_gro_receive+0x2f8/0x410 net/core/dev.c:4980
 receive_buf+0x52b/0x3fb0 drivers/net/virtio_net.c:852
 virtnet_receive drivers/net/virtio_net.c:1098 [inline]
 virtnet_poll+0x515/0xa6e drivers/net/virtio_net.c:1189
 napi_poll net/core/dev.c:5598 [inline]
 net_rx_action+0x490/0xf80 net/core/dev.c:5664
 __do_softirq+0x244/0x9a0 kernel/softirq.c:288

Freed by task 11515:
 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 net/core/skbuff.c:586 [inline]
 kfree_skbmem+0xac/0x120 net/core/skbuff.c:580
 __kfree_skb net/core/skbuff.c:646 [inline]
 kfree_skb+0xbd/0x340 net/core/skbuff.c:663
 packet_rcv_spkt+0xd9/0x560 net/packet/af_packet.c:1888
 deliver_skb net/core/dev.c:1881 [inline]
 deliver_ptype_list_skb net/core/dev.c:1896 [inline]
 __netif_receive_skb_core+0x9ef/0x2ca0 net/core/dev.c:4460
 __netif_receive_skb+0x2c/0x1b0 net/core/dev.c:4515
 netif_receive_skb_internal+0xe4/0x5a0 net/core/dev.c:4588
 napi_skb_finish net/core/dev.c:4949 [inline]
 napi_gro_receive+0x2f8/0x410 net/core/dev.c:4980
 receive_buf+0x52b/0x3fb0 drivers/net/virtio_net.c:852
 virtnet_receive drivers/net/virtio_net.c:1098 [inline]
 virtnet_poll+0x515/0xa6e drivers/net/virtio_net.c:1189
 napi_poll net/core/dev.c:5598 [inline]
 net_rx_action+0x490/0xf80 net/core/dev.c:5664
 __do_softirq+0x244/0x9a0 kernel/softirq.c:288

The buggy address belongs to the object at ffff888094305200
 which belongs to the cache skbuff_head_cache of size 232
The buggy address is located 144 bytes inside of
 232-byte region [ffff888094305200, ffff8880943052e8)
The buggy address belongs to the page:
page:ffffea000250c140 count:1 mapcount:0 mapping:ffff8880943050c0 index:0x0
flags: 0x1fffc0000000100(slab)
raw: 01fffc0000000100 ffff8880943050c0 0000000000000000 000000010000000c
raw: ffffea0002a1ec20 ffffea000254d320 ffff88821b75f3c0 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff888094305180: fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc
 ffff888094305200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888094305280: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc
                         ^
 ffff888094305300: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
 ffff888094305380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (6):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/11/21 16:37 linux-4.14.y f56f3d0e65ad 8098ea0f .config console log report ci2-linux-4-14
2019/11/11 14:27 linux-4.14.y c9fda4f22428 dc438b91 .config console log report ci2-linux-4-14
2019/11/10 21:38 linux-4.14.y c9fda4f22428 dc438b91 .config console log report ci2-linux-4-14
2019/10/25 05:52 linux-4.14.y b98aebd29824 d01bb02a .config console log report ci2-linux-4-14
2019/09/30 10:14 linux-4.14.y f6e27dbb1afa c1ad5441 .config console log report ci2-linux-4-14
2019/08/17 03:50 linux-4.14.y 45f092f9e9cb 8fd428a1 .config console log report ci2-linux-4-14
* Struck through repros no longer work on HEAD.