syzbot


KASAN: use-after-free Read in bpf_skb_change_tail

Status: auto-closed as invalid on 2019/12/13 14:45
Reported-by: syzbot+3491f0cfef94ffd23bfb@syzkaller.appspotmail.com
First crash: 1925d, last: 1925d
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-414 KASAN: use-after-free Read in bpf_skb_change_tail 2 2194d 2048d 0/1 auto-closed as invalid on 2019/05/18 04:13
android-414 KASAN: use-after-free Read in bpf_skb_change_tail (2) C 3 1925d 1930d 0/1 public: reported C repro on 2019/08/10 10:38

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in ____bpf_skb_change_tail net/core/filter.c:2371 [inline]
BUG: KASAN: use-after-free in bpf_skb_change_tail+0xa7f/0xba0 net/core/filter.c:2368
Read of size 8 at addr ffff888092d2db50 by task syz-executor.3/15061

CPU: 0 PID: 15061 Comm: syz-executor.3 Not tainted 4.14.138 #34
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+0x138/0x19c 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
 ____bpf_skb_change_tail net/core/filter.c:2371 [inline]
 bpf_skb_change_tail+0xa7f/0xba0 net/core/filter.c:2368
 bpf_prog_ac477e10ee530e9d+0x963/0x1000

Allocated by task 14933:
 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_node+0x144/0x780 mm/slab.c:3642
 __alloc_skb+0x9c/0x500 net/core/skbuff.c:193
 alloc_skb include/linux/skbuff.h:980 [inline]
 dccp_send_ack+0xc7/0x330 net/dccp/output.c:580
 ccid2_hc_rx_packet_recv+0x10e/0x180 net/dccp/ccids/ccid2.c:778
 ccid_hc_rx_packet_recv net/dccp/ccid.h:185 [inline]
 dccp_deliver_input_to_ccids+0xdd/0x250 net/dccp/input.c:180
 dccp_rcv_established net/dccp/input.c:378 [inline]
 dccp_rcv_established+0x6b/0xb0 net/dccp/input.c:368
 dccp_v4_do_rcv+0x122/0x170 net/dccp/ipv4.c:656
 sk_backlog_rcv include/net/sock.h:912 [inline]
 __sk_receive_skb+0x226/0x950 net/core/sock.c:511
 dccp_v4_rcv+0xd47/0x1903 net/dccp/ipv4.c:877
 ip_local_deliver_finish+0x25e/0xad0 net/ipv4/ip_input.c:216
 NF_HOOK include/linux/netfilter.h:250 [inline]
 NF_HOOK include/linux/netfilter.h:244 [inline]
 ip_local_deliver+0x1c3/0x4a0 net/ipv4/ip_input.c:257
 dst_input include/net/dst.h:468 [inline]
 ip_rcv_finish+0x7be/0x1a50 net/ipv4/ip_input.c:396
 NF_HOOK include/linux/netfilter.h:250 [inline]
 NF_HOOK include/linux/netfilter.h:244 [inline]
 ip_rcv+0xaa5/0x112b net/ipv4/ip_input.c:493
 __netif_receive_skb_core+0x1eae/0x2ca0 net/core/dev.c:4477
 __netif_receive_skb+0x2c/0x1b0 net/core/dev.c:4515
 process_backlog+0x21f/0x730 net/core/dev.c:5197
 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 14933:
 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+0x1e/0x30 net/core/skbuff.c:646
 __dccp_rcv_established.isra.0+0x178/0x340 net/dccp/input.c:364
 dccp_rcv_established net/dccp/input.c:380 [inline]
 dccp_rcv_established+0x76/0xb0 net/dccp/input.c:368
 dccp_v4_do_rcv+0x122/0x170 net/dccp/ipv4.c:656
 sk_backlog_rcv include/net/sock.h:912 [inline]
 __release_sock+0x12d/0x350 net/core/sock.c:2259
 release_sock+0x59/0x1b0 net/core/sock.c:2774
 dccp_sendmsg+0x57e/0x950 net/dccp/proto.c:813
 inet_sendmsg+0x122/0x500 net/ipv4/af_inet.c:762
 sock_sendmsg_nosec net/socket.c:646 [inline]
 sock_sendmsg+0xce/0x110 net/socket.c:656
 ___sys_sendmsg+0x349/0x840 net/socket.c:2062
 __sys_sendmmsg+0x152/0x3a0 net/socket.c:2152
 SYSC_sendmmsg net/socket.c:2183 [inline]
 SyS_sendmmsg+0x35/0x60 net/socket.c:2178
 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 ffff888092d2dac0
 which belongs to the cache skbuff_head_cache of size 232
The buggy address is located 144 bytes inside of
 232-byte region [ffff888092d2dac0, ffff888092d2dba8)
The buggy address belongs to the page:
page:ffffea00024b4b40 count:1 mapcount:0 mapping:ffff888092d2d0c0 index:0xffff888092d2d980
flags: 0x1fffc0000000100(slab)
raw: 01fffc0000000100 ffff888092d2d0c0 ffff888092d2d980 0000000100000008
raw: ffffea000245d460 ffffea0002643ee0 ffff88821b75f240 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff888092d2da00: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc
 ffff888092d2da80: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
>ffff888092d2db00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                 ^
 ffff888092d2db80: fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc
 ffff888092d2dc00: 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/08/15 14:44 linux-4.14.y 3ffe1e79c174 0d298d6b .config console log report ci2-linux-4-14
* Struck through repros no longer work on HEAD.