syzbot


general protection fault in em_cmp_match

Status: fixed on 2023/02/02 00:40
Reported-by: syzbot+963f7637dae8becc038f@syzkaller.appspotmail.com
Fix commit: 5478eb7adcc5 net_sched: reject TCF_EM_SIMPLE case for complex ematch module
First crash: 473d, last: 473d
Cause bisection: failed (error log, bisect log)
  
Discussions (2)
Title Replies (including bot) Last reply
[PATCH net v2] net: sched: ematch: reject invalid data 4 (4) 2022/12/17 21:37
[PATCH] net_sched: ematch: reject invalid data 2 (2) 2022/12/13 03:38
Similar bugs (4)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 general protection fault in em_cmp_match C 1 470d 470d 0/1 upstream: reported C repro on 2022/12/14 11:01
android-5-10 general protection fault in em_cmp_match C error 1 473d 473d 2/2 fixed on 2023/05/04 14:51
linux-4.14 general protection fault in em_cmp_match C 1 465d 465d 1/1 fixed on 2023/01/18 11:20
upstream general protection fault in em_cmp_match net C 4 473d 469d 22/26 fixed on 2023/02/24 13:50
Last patch testing requests (4)
Created Duration User Patch Repo Result
2022/12/19 02:06 16m jun.nie@linaro.org patch upstream OK log
2022/12/13 14:24 6m jun.nie@linaro.org git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git e42617b825f80 error OK
2022/12/12 09:48 16m jun.nie@linaro.org patch upstream OK log
2022/12/12 05:47 7m jun.nie@linaro.org upstream report log

Sample crash report:
general protection fault, probably for non-canonical address 0xdffffc0000000001: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f]
CPU: 0 PID: 6 Comm: kworker/0:0 Not tainted 5.15.77-syzkaller-00764-g7048384c9872 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
Workqueue: wg-crypt-wg2 wg_packet_tx_worker
RIP: 0010:em_cmp_match+0x4e/0x5f0 net/sched/em_cmp.c:25
Code: 66 fd 48 83 c3 08 48 89 d8 48 c1 e8 03 42 80 3c 38 00 74 08 48 89 df e8 90 ec a8 fd 4c 8b 33 49 8d 5e 0a 48 89 d8 48 c1 e8 03 <42> 8a 04 38 84 c0 0f 85 0f 04 00 00 0f b7 1b 48 89 5d d0 c1 eb 08
RSP: 0018:ffffc90000066fd8 EFLAGS: 00010202
RAX: 0000000000000001 RBX: 000000000000000a RCX: ffff88810034e2c0
RDX: 0000000000000000 RSI: ffff88811490ba00 RDI: ffff88811bd683c0
RBP: ffffc90000067010 R08: ffffffff840b00b5 R09: ffffc900000670a0
R10: fffff5200000ce24 R11: 1ffff9200000ce14 R12: ffffffff86f34d10
R13: ffff88811bd683c0 R14: 0000000000000000 R15: dffffc0000000000
FS:  0000000000000000(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020000080 CR3: 000000011eed7000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 tcf_em_match net/sched/ematch.c:492 [inline]
 __tcf_em_tree_match+0x194/0x720 net/sched/ematch.c:518
 tcf_em_tree_match include/net/pkt_cls.h:463 [inline]
 basic_classify+0xd8/0x250 net/sched/cls_basic.c:48
 __tcf_classify net/sched/cls_api.c:1549 [inline]
 tcf_classify+0x161/0x430 net/sched/cls_api.c:1589
 prio_classify net/sched/sch_prio.c:42 [inline]
 prio_enqueue+0x1d3/0x6a0 net/sched/sch_prio.c:75
 dev_qdisc_enqueue net/core/dev.c:3792 [inline]
 __dev_xmit_skb+0x35c/0x1650 net/core/dev.c:3876
 __dev_queue_xmit+0x8f3/0x1b50 net/core/dev.c:4193
 dev_queue_xmit+0x17/0x20 net/core/dev.c:4261
 neigh_hh_output include/net/neighbour.h:508 [inline]
 neigh_output include/net/neighbour.h:522 [inline]
 ip_finish_output2+0xc0f/0xf00 net/ipv4/ip_output.c:228
 __ip_finish_output+0x163/0x370
 ip_finish_output+0x20b/0x220 net/ipv4/ip_output.c:316
 NF_HOOK_COND include/linux/netfilter.h:299 [inline]
 ip_output+0x1e9/0x410 net/ipv4/ip_output.c:430
 dst_output include/net/dst.h:450 [inline]
 ip_local_out+0x92/0xb0 net/ipv4/ip_output.c:126
 iptunnel_xmit+0x4a2/0x890 net/ipv4/ip_tunnel_core.c:82
 udp_tunnel_xmit_skb+0x1b6/0x2c0 net/ipv4/udp_tunnel_core.c:175
 send4+0x78d/0xd20 drivers/net/wireguard/socket.c:85
 wg_socket_send_skb_to_peer+0xd5/0x1d0 drivers/net/wireguard/socket.c:175
 wg_packet_create_data_done drivers/net/wireguard/send.c:251 [inline]
 wg_packet_tx_worker+0x202/0x560 drivers/net/wireguard/send.c:276
 process_one_work+0x6db/0xc00 kernel/workqueue.c:2313
 worker_thread+0xb3e/0x1340 kernel/workqueue.c:2460
 kthread+0x41c/0x500 kernel/kthread.c:319
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
 </TASK>
Modules linked in:
---[ end trace 96ef6555c9d22182 ]---
RIP: 0010:em_cmp_match+0x4e/0x5f0 net/sched/em_cmp.c:25
Code: 66 fd 48 83 c3 08 48 89 d8 48 c1 e8 03 42 80 3c 38 00 74 08 48 89 df e8 90 ec a8 fd 4c 8b 33 49 8d 5e 0a 48 89 d8 48 c1 e8 03 <42> 8a 04 38 84 c0 0f 85 0f 04 00 00 0f b7 1b 48 89 5d d0 c1 eb 08
RSP: 0018:ffffc90000066fd8 EFLAGS: 00010202
RAX: 0000000000000001 RBX: 000000000000000a RCX: ffff88810034e2c0
RDX: 0000000000000000 RSI: ffff88811490ba00 RDI: ffff88811bd683c0
RBP: ffffc90000067010 R08: ffffffff840b00b5 R09: ffffc900000670a0
R10: fffff5200000ce24 R11: 1ffff9200000ce14 R12: ffffffff86f34d10
R13: ffff88811bd683c0 R14: 0000000000000000 R15: dffffc0000000000
FS:  0000000000000000(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020000080 CR3: 000000011eed7000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	66 fd                	data16 std
   2:	48 83 c3 08          	add    $0x8,%rbx
   6:	48 89 d8             	mov    %rbx,%rax
   9:	48 c1 e8 03          	shr    $0x3,%rax
   d:	42 80 3c 38 00       	cmpb   $0x0,(%rax,%r15,1)
  12:	74 08                	je     0x1c
  14:	48 89 df             	mov    %rbx,%rdi
  17:	e8 90 ec a8 fd       	callq  0xfda8ecac
  1c:	4c 8b 33             	mov    (%rbx),%r14
  1f:	49 8d 5e 0a          	lea    0xa(%r14),%rbx
  23:	48 89 d8             	mov    %rbx,%rax
  26:	48 c1 e8 03          	shr    $0x3,%rax
* 2a:	42 8a 04 38          	mov    (%rax,%r15,1),%al <-- trapping instruction
  2e:	84 c0                	test   %al,%al
  30:	0f 85 0f 04 00 00    	jne    0x445
  36:	0f b7 1b             	movzwl (%rbx),%ebx
  39:	48 89 5d d0          	mov    %rbx,-0x30(%rbp)
  3d:	c1 eb 08             	shr    $0x8,%ebx

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/12/11 00:31 android13-5.15-lts 7048384c9872 67be1ae7 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci2-android-5-15 general protection fault in em_cmp_match
* Struck through repros no longer work on HEAD.