syzbot


general protection fault in em_cmp_match

Status: fixed on 2023/05/04 14:51
Reported-by: syzbot+d20933a868ac6b7b379b@syzkaller.appspotmail.com
Fix commit: 5c544c7c6afa net_sched: reject TCF_EM_SIMPLE case for complex ematch module
First crash: 500d, last: 500d
Cause bisection: failed (error log, bisect log)
  
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 497d 497d 0/1 upstream: reported C repro on 2022/12/14 11:01
linux-4.14 general protection fault in em_cmp_match C 1 492d 492d 1/1 fixed on 2023/01/18 11:20
android-5-15 general protection fault in em_cmp_match C error 1 500d 500d 2/2 fixed on 2023/02/02 00:40
upstream general protection fault in em_cmp_match net C 4 500d 496d 22/26 fixed on 2023/02/24 13:50
Last patch testing requests (3)
Created Duration User Patch Repo Result
2022/12/12 08:36 7m tudor.ambarus@linaro.org git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git linux-5.15.y report log
2022/12/12 08:36 8m tudor.ambarus@linaro.org git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git linux-5.10.y report log
2022/12/12 08:34 9m tudor.ambarus@linaro.org git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master 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: 68 Comm: kworker/0:1 Not tainted 5.10.157-syzkaller-01102-gf3226d86f8ce #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/0x580 net/sched/em_cmp.c:25
Code: 89 fd 48 83 c3 08 48 89 d8 48 c1 e8 03 42 80 3c 38 00 74 08 48 89 df e8 a0 61 c3 fd 4c 8b 33 49 8d 5e 0a 48 89 d8 48 c1 e8 03 <42> 8a 04 38 84 c0 0f 85 dd 03 00 00 0f b7 1b 48 89 5d d0 c1 eb 08
RSP: 0018:ffffc9000024f0f8 EFLAGS: 00010202
RAX: 0000000000000001 RBX: 000000000000000a RCX: ffff8881065fcf00
RDX: 0000000000000000 RSI: ffff88811388d2c0 RDI: ffff8881141c2500
RBP: ffffc9000024f130 R08: ffffffff83e3b005 R09: ffffc9000024f1c0
R10: fffff52000049e48 R11: 1ffff92000049e38 R12: ffffffff868e0510
R13: ffff8881141c2500 R14: 0000000000000000 R15: dffffc0000000000
FS:  0000000000000000(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fff773eaff8 CR3: 00000001057f0000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 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:467 [inline]
 basic_classify+0xd8/0x250 net/sched/cls_basic.c:48
 __tcf_classify net/sched/cls_api.c:1550 [inline]
 tcf_classify+0x161/0x430 net/sched/cls_api.c:1587
 prio_classify net/sched/sch_prio.c:42 [inline]
 prio_enqueue+0x1d0/0x6a0 net/sched/sch_prio.c:75
 __dev_xmit_skb net/core/dev.c:3827 [inline]
 __dev_queue_xmit+0xd71/0x2a20 net/core/dev.c:4141
 dev_queue_xmit+0x17/0x20 net/core/dev.c:4209
 neigh_hh_output include/net/neighbour.h:508 [inline]
 neigh_output include/net/neighbour.h:522 [inline]
 ip_finish_output2+0xb25/0xfd0 net/ipv4/ip_output.c:237
 __ip_finish_output+0x412/0x750 net/ipv4/ip_output.c:259
 ip_finish_output+0x1c9/0x1e0 net/ipv4/ip_output.c:325
 NF_HOOK_COND include/linux/netfilter.h:293 [inline]
 ip_output+0x1e9/0x410 net/ipv4/ip_output.c:439
 dst_output include/net/dst.h:443 [inline]
 ip_local_out+0x92/0xb0 net/ipv4/ip_output.c:126
 iptunnel_xmit+0x45e/0x830 net/ipv4/ip_tunnel_core.c:82
 udp_tunnel_xmit_skb+0x1b6/0x2c0 net/ipv4/udp_tunnel_core.c:190
 send4+0x609/0xd30 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+0x1f2/0x510 drivers/net/wireguard/send.c:276
 process_one_work+0x726/0xc10 kernel/workqueue.c:2296
 worker_thread+0xb27/0x1550 kernel/workqueue.c:2442
 kthread+0x349/0x3d0 kernel/kthread.c:313
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:299
Modules linked in:
---[ end trace a14651166ff1a6b6 ]---
RIP: 0010:em_cmp_match+0x4e/0x580 net/sched/em_cmp.c:25
Code: 89 fd 48 83 c3 08 48 89 d8 48 c1 e8 03 42 80 3c 38 00 74 08 48 89 df e8 a0 61 c3 fd 4c 8b 33 49 8d 5e 0a 48 89 d8 48 c1 e8 03 <42> 8a 04 38 84 c0 0f 85 dd 03 00 00 0f b7 1b 48 89 5d d0 c1 eb 08
RSP: 0018:ffffc9000024f0f8 EFLAGS: 00010202
RAX: 0000000000000001 RBX: 000000000000000a RCX: ffff8881065fcf00
RDX: 0000000000000000 RSI: ffff88811388d2c0 RDI: ffff8881141c2500
RBP: ffffc9000024f130 R08: ffffffff83e3b005 R09: ffffc9000024f1c0
R10: fffff52000049e48 R11: 1ffff92000049e38 R12: ffffffff868e0510
R13: ffff8881141c2500 R14: 0000000000000000 R15: dffffc0000000000
FS:  0000000000000000(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fff773eaff8 CR3: 00000001057f0000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	89 fd                	mov    %edi,%ebp
   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 a0 61 c3 fd       	callq  0xfdc361bc
  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 dd 03 00 00    	jne    0x413
  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:07 android12-5.10-lts f3226d86f8ce 67be1ae7 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci2-android-5-10 general protection fault in em_cmp_match
* Struck through repros no longer work on HEAD.