syzbot


KASAN: use-after-free Read in __skb_flow_dissect

Status: auto-closed as invalid on 2021/08/03 02:14
Subsystems: net
[Documentation on labels]
First crash: 1354d, last: 1256d
Similar bugs (3)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in __skb_flow_dissect (2) net C done unreliable 6 621d 799d 0/28 closed as invalid on 2023/03/21 17:25
upstream KASAN: use-after-free Read in __skb_flow_dissect (3) net C 1 274d 284d 25/28 fixed on 2024/03/26 00:54
upstream Internal error in __skb_flow_dissect net 1 522d 518d 0/28 auto-obsoleted due to no activity on 2023/08/07 05:35

Sample crash report:
Dead loop on virtual device gre0, fix it urgently!
==================================================================
BUG: KASAN: use-after-free in __skb_flow_dissect+0x4ae7/0x4e00 net/core/flow_dissector.c:1039
Read of size 1 at addr ffff8881ab54000e by task syz-executor.2/19172

CPU: 1 PID: 19172 Comm: syz-executor.2 Not tainted 5.12.0-rc7-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:79 [inline]
 dump_stack+0x141/0x1d7 lib/dump_stack.c:120
 print_address_description.constprop.0.cold+0x5b/0x2f8 mm/kasan/report.c:232
 __kasan_report mm/kasan/report.c:399 [inline]
 kasan_report.cold+0x7c/0xd8 mm/kasan/report.c:416
 __skb_flow_dissect+0x4ae7/0x4e00 net/core/flow_dissector.c:1039
 skb_flow_dissect_flow_keys include/linux/skbuff.h:1331 [inline]
 ___skb_get_hash net/core/flow_dissector.c:1564 [inline]
 __skb_get_hash+0xbe/0x230 net/core/flow_dissector.c:1630
 skb_get_hash include/linux/skbuff.h:1373 [inline]
 ip_tunnel_xmit+0x16cf/0x2b00 net/ipv4/ip_tunnel.c:722
 ipip_tunnel_xmit+0x406/0x500 net/ipv4/ipip.c:305
 __netdev_start_xmit include/linux/netdevice.h:4825 [inline]
 netdev_start_xmit include/linux/netdevice.h:4839 [inline]
 xmit_one net/core/dev.c:3605 [inline]
 dev_hard_start_xmit+0x1eb/0x920 net/core/dev.c:3621
 __dev_queue_xmit+0x2121/0x2e00 net/core/dev.c:4194
 neigh_connected_output+0x3b6/0x510 net/core/neighbour.c:1524
 neigh_output include/net/neighbour.h:510 [inline]
 ip_finish_output2+0x83d/0x21f0 net/ipv4/ip_output.c:230
 __ip_finish_output net/ipv4/ip_output.c:308 [inline]
 __ip_finish_output+0x396/0x640 net/ipv4/ip_output.c:290
 ip_finish_output+0x35/0x200 net/ipv4/ip_output.c:318
 NF_HOOK_COND include/linux/netfilter.h:290 [inline]
 ip_output+0x196/0x310 net/ipv4/ip_output.c:432
 dst_output include/net/dst.h:448 [inline]
 ip_local_out+0xaf/0x1a0 net/ipv4/ip_output.c:126
 iptunnel_xmit+0x5a3/0x9c0 net/ipv4/ip_tunnel_core.c:82
 ip_tunnel_xmit+0x1116/0x2b00 net/ipv4/ip_tunnel.c:804
 ipgre_xmit+0x679/0x830 net/ipv4/ip_gre.c:648
 __netdev_start_xmit include/linux/netdevice.h:4825 [inline]
 netdev_start_xmit include/linux/netdevice.h:4839 [inline]
 xmit_one net/core/dev.c:3605 [inline]
 dev_hard_start_xmit+0x1eb/0x920 net/core/dev.c:3621
 __dev_queue_xmit+0x2121/0x2e00 net/core/dev.c:4194
 __bpf_tx_skb net/core/filter.c:2116 [inline]
 __bpf_redirect_no_mac net/core/filter.c:2141 [inline]
 __bpf_redirect+0x548/0xc80 net/core/filter.c:2164
 ____bpf_clone_redirect net/core/filter.c:2448 [inline]
 bpf_clone_redirect+0x2ae/0x420 net/core/filter.c:2420
 bpf_prog_bebbfe2050753572+0x56/0x320
 bpf_dispatcher_nop_func include/linux/bpf.h:661 [inline]
 bpf_test_run+0x3f1/0xc50 net/bpf/test_run.c:50
 bpf_prog_test_run_skb+0xabc/0x1c50 net/bpf/test_run.c:582
 bpf_prog_test_run kernel/bpf/syscall.c:3132 [inline]
 __do_sys_bpf+0x218b/0x4f40 kernel/bpf/syscall.c:4411
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x4665f9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f5017997188 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 000000000056c0b0 RCX: 00000000004665f9
RDX: 0000000000000028 RSI: 0000000020000080 RDI: 000000000000000a
RBP: 00000000004bfce1 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056c0b0
R13: 00007fff26cc7cff R14: 00007f5017997300 R15: 0000000000022000

The buggy address belongs to the page:
page:ffffea0006ad5000 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1ab540
flags: 0x57ff00000000000()
raw: 057ff00000000000 ffffea0006ad5008 ffffea0006ad5008 0000000000000000
raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8881ab53ff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff8881ab53ff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff8881ab540000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                      ^
 ffff8881ab540080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff8881ab540100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/05/05 02:10 net-old bbd6f0a94813 06c27ff5 .config console log report info ci-upstream-net-this-kasan-gce KASAN: use-after-free Read in __skb_flow_dissect
2021/03/01 17:18 net-next-old d310ec03a34e 4c37c133 .config console log report info ci-upstream-net-kasan-gce KASAN: use-after-free Read in __skb_flow_dissect
2021/01/27 09:34 net-next-old 6626a0266566 a0ebf917 .config console log report info ci-upstream-net-kasan-gce KASAN: use-after-free Read in __skb_flow_dissect
* Struck through repros no longer work on HEAD.