syzbot


general protection fault in em_cmp_match

Status: fixed on 2023/01/18 11:20
Reported-by: syzbot+0d44fe152dedbafa4bc9@syzkaller.appspotmail.com
Fix commit: b9b47801cef5 net_sched: reject TCF_EM_SIMPLE case for complex ematch module
First crash: 524d, last: 524d
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 529d 529d 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 532d 532d 2/2 fixed on 2023/05/04 14:51
android-5-15 general protection fault in em_cmp_match C error 1 532d 532d 2/2 fixed on 2023/02/02 00:40
upstream general protection fault in em_cmp_match net C 4 532d 528d 22/26 fixed on 2023/02/24 13:50

Sample crash report:
kasan: CONFIG_KASAN_INLINE enabled
kasan: GPF could be caused by NULL-ptr deref or user memory access
general protection fault: 0000 [#1] PREEMPT SMP KASAN
Modules linked in:
CPU: 1 PID: 23 Comm: kworker/1:1 Not tainted 4.14.302-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
Workqueue: ipv6_addrconf addrconf_dad_work
task: ffff8880b5600600 task.stack: ffff8880b5608000
RIP: 0010:em_cmp_match+0x4d/0x4f0 net/sched/em_cmp.c:29
RSP: 0018:ffff8880b560edf8 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000001 RSI: ffff8880a996aec0 RDI: 000000000000000a
RBP: 0000000000000001 R08: ffffffff8ba64cac R09: 0000000000001da8
R10: 0000000000000001 R11: ffff8880b5600600 R12: ffff8880b4bb4400
R13: ffff8880a996aec0 R14: ffffffff89d1c860 R15: 0000000000000000
FS:  0000000000000000(0000) GS:ffff8880ba500000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f48ebadf3a0 CR3: 0000000008e6a000 CR4: 00000000003406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 tcf_em_match net/sched/ematch.c:496 [inline]
 __tcf_em_tree_match+0x131/0x460 net/sched/ematch.c:522
 tcf_em_tree_match include/net/pkt_cls.h:367 [inline]
 basic_classify+0x193/0x280 net/sched/cls_basic.c:51
 tcf_classify+0xfd/0x300 net/sched/cls_api.c:337
 prio_classify net/sched/sch_prio.c:46 [inline]
 prio_enqueue+0x30c/0x670 net/sched/sch_prio.c:77
 __dev_xmit_skb net/core/dev.c:3225 [inline]
 __dev_queue_xmit+0x121d/0x2480 net/core/dev.c:3489
 neigh_hh_output include/net/neighbour.h:490 [inline]
 neigh_output include/net/neighbour.h:498 [inline]
 ip_finish_output2+0x9db/0x1340 net/ipv4/ip_output.c:237
 ip_finish_output+0x37c/0xc50 net/ipv4/ip_output.c:325
 NF_HOOK_COND include/linux/netfilter.h:239 [inline]
 ip_output+0x1cd/0x510 net/ipv4/ip_output.c:413
 dst_output include/net/dst.h:470 [inline]
 ip_local_out+0x93/0x170 net/ipv4/ip_output.c:125
 iptunnel_xmit+0x5cc/0x950 net/ipv4/ip_tunnel_core.c:91
 geneve_xmit_skb drivers/net/geneve.c:866 [inline]
 geneve_xmit+0xf15/0x2ca0 drivers/net/geneve.c:947
 __netdev_start_xmit include/linux/netdevice.h:4054 [inline]
 netdev_start_xmit include/linux/netdevice.h:4063 [inline]
 xmit_one net/core/dev.c:3005 [inline]
 dev_hard_start_xmit+0x188/0x890 net/core/dev.c:3021
 __dev_queue_xmit+0x1d7f/0x2480 net/core/dev.c:3521
 neigh_resolve_output+0x4e5/0x870 net/core/neighbour.c:1384
 neigh_output include/net/neighbour.h:500 [inline]
 ip6_finish_output2+0xf48/0x1f10 net/ipv6/ip6_output.c:120
 ip6_finish_output+0x5c6/0xd50 net/ipv6/ip6_output.c:192
 NF_HOOK_COND include/linux/netfilter.h:239 [inline]
 ip6_output+0x1c5/0x660 net/ipv6/ip6_output.c:209
 dst_output include/net/dst.h:470 [inline]
 NF_HOOK include/linux/netfilter.h:250 [inline]
 ndisc_send_skb+0x82a/0x1390 net/ipv6/ndisc.c:483
 ndisc_send_ns+0x4ca/0x7c0 net/ipv6/ndisc.c:625
 addrconf_dad_work+0x96f/0xef0 net/ipv6/addrconf.c:4012
 process_one_work+0x793/0x14a0 kernel/workqueue.c:2117
 worker_thread+0x5cc/0xff0 kernel/workqueue.c:2251
 kthread+0x30d/0x420 kernel/kthread.c:232
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:406
Code: df 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 4c 04 00 00 48 b8 00 00 00 00 00 fc ff df 48 8b 5b 08 48 8d 7b 0a 48 89 fa 48 c1 ea 03 <0f> b6 14 02 48 89 f8 83 e0 07 83 c0 01 38 d0 7c 08 84 d2 0f 85 
RIP: em_cmp_match+0x4d/0x4f0 net/sched/em_cmp.c:29 RSP: ffff8880b560edf8
---[ end trace d7341b3d0a69401a ]---
----------------
Code disassembly (best guess):
   0:	df 48 89             	fisttps -0x77(%rax)
   3:	fa                   	cli
   4:	48 c1 ea 03          	shr    $0x3,%rdx
   8:	80 3c 02 00          	cmpb   $0x0,(%rdx,%rax,1)
   c:	0f 85 4c 04 00 00    	jne    0x45e
  12:	48 b8 00 00 00 00 00 	movabs $0xdffffc0000000000,%rax
  19:	fc ff df
  1c:	48 8b 5b 08          	mov    0x8(%rbx),%rbx
  20:	48 8d 7b 0a          	lea    0xa(%rbx),%rdi
  24:	48 89 fa             	mov    %rdi,%rdx
  27:	48 c1 ea 03          	shr    $0x3,%rdx
* 2b:	0f b6 14 02          	movzbl (%rdx,%rax,1),%edx <-- trapping instruction
  2f:	48 89 f8             	mov    %rdi,%rax
  32:	83 e0 07             	and    $0x7,%eax
  35:	83 c0 01             	add    $0x1,%eax
  38:	38 d0                	cmp    %dl,%al
  3a:	7c 08                	jl     0x44
  3c:	84 d2                	test   %dl,%dl
  3e:	0f                   	.byte 0xf
  3f:	85                   	.byte 0x85

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/12/19 07:43 linux-4.14.y c4215ee4771b 05494336 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-4-14 general protection fault in em_cmp_match
* Struck through repros no longer work on HEAD.