syzbot


BUG: unable to handle kernel paging request in ovs_vport_add

Status: fixed on 2023/10/12 12:48
Subsystems: openvswitch
[Documentation on labels]
Reported-by: syzbot+7456b5dcf65111553320@syzkaller.appspotmail.com
Fix commit: a552bfa16bab net: openvswitch: reject negative ifindex
First crash: 480d, last: 480d
Cause bisection: introduced by (bisect log) :
commit 759ab1edb56c88906830fd6b2e7b12514dd32758
Author: Jakub Kicinski <kuba@kernel.org>
Date: Wed Jul 26 18:55:29 2023 +0000

  net: store netdevs in an xarray

Crash: BUG: unable to handle kernel paging request in ovs_vport_add (log)
Repro: C syz .config
  
Discussions (2)
Title Replies (including bot) Last reply
[PATCH net] net: openvswitch: reject negative ifindex 6 (6) 2023/08/16 12:05
[syzbot] [openvswitch?] BUG: unable to handle kernel paging request in ovs_vport_add 0 (1) 2023/08/11 13:59

Sample crash report:
netlink: 'syz-executor294': attribute type 9 has an invalid length.
BUG: unable to handle page fault for address: fffffbfff412f978
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
PGD 23ffe4067 P4D 23ffe4067 PUD 23ffe3067 PMD 19e75067 PTE 0
Oops: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 5027 Comm: syz-executor294 Not tainted 6.5.0-rc4-syzkaller-01306-g29afcd69672a #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023
RIP: 0010:ovs_vport_name net/openvswitch/vport.h:196 [inline]
RIP: 0010:ovs_vport_add+0x17a/0x4c0 net/openvswitch/vport.c:223
Code: 89 c6 e8 39 16 78 f7 48 81 fd 00 f0 ff ff 0f 87 5b 02 00 00 e8 97 1a 78 f7 48 89 ea 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 <80> 3c 02 00 0f 85 11 03 00 00 48 8d 7d 10 48 8b 75 00 48 b8 00 00
RSP: 0018:ffffc900038f73d0 EFLAGS: 00010a06
RAX: dffffc0000000000 RBX: ffffffff8e8df240 RCX: 0000000000000000
RDX: 1ffffffff412f978 RSI: ffffffff8a0e0579 RDI: 0000000000000007
RBP: ffffffffa097cbc2 R08: 0000000000000007 R09: fffffffffffff000
R10: ffffffffa097cbc2 R11: ffffffff8a40008b R12: ffffffff8e8df270
R13: dffffc0000000000 R14: ffffc900038f74d0 R15: ffffc900038f74d8
FS:  0000555556e67380(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: fffffbfff412f978 CR3: 000000007ab37000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 new_vport+0x16/0x1c0 net/openvswitch/datapath.c:203
 ovs_dp_cmd_new+0x6a1/0xe70 net/openvswitch/datapath.c:1841
 genl_family_rcv_msg_doit.isra.0+0x1ef/0x2d0 net/netlink/genetlink.c:974
 genl_family_rcv_msg net/netlink/genetlink.c:1054 [inline]
 genl_rcv_msg+0x559/0x800 net/netlink/genetlink.c:1071
 netlink_rcv_skb+0x16b/0x440 net/netlink/af_netlink.c:2575
 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1082
 netlink_unicast_kernel net/netlink/af_netlink.c:1344 [inline]
 netlink_unicast+0x539/0x800 net/netlink/af_netlink.c:1370
 netlink_sendmsg+0x93c/0xe40 net/netlink/af_netlink.c:1939
 sock_sendmsg_nosec net/socket.c:728 [inline]
 sock_sendmsg+0xd9/0x180 net/socket.c:751
 ____sys_sendmsg+0x6ac/0x940 net/socket.c:2514
 ___sys_sendmsg+0x135/0x1d0 net/socket.c:2568
 __sys_sendmsg+0x117/0x1e0 net/socket.c:2597
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fa80bfd7569
Code: 48 83 c4 28 c3 e8 37 17 00 00 0f 1f 80 00 00 00 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffdf3beb468 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00007ffdf3beb638 RCX: 00007fa80bfd7569
RDX: 0000000000000000 RSI: 0000000020000100 RDI: 0000000000000003
RBP: 00007fa80c04b610 R08: 000000000000000c R09: 00007ffdf3beb638
R10: 0000000000001004 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffdf3beb628 R14: 0000000000000001 R15: 0000000000000001
 </TASK>
Modules linked in:
CR2: fffffbfff412f978
---[ end trace 0000000000000000 ]---
RIP: 0010:ovs_vport_name net/openvswitch/vport.h:196 [inline]
RIP: 0010:ovs_vport_add+0x17a/0x4c0 net/openvswitch/vport.c:223
Code: 89 c6 e8 39 16 78 f7 48 81 fd 00 f0 ff ff 0f 87 5b 02 00 00 e8 97 1a 78 f7 48 89 ea 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 <80> 3c 02 00 0f 85 11 03 00 00 48 8d 7d 10 48 8b 75 00 48 b8 00 00
RSP: 0018:ffffc900038f73d0 EFLAGS: 00010a06
RAX: dffffc0000000000 RBX: ffffffff8e8df240 RCX: 0000000000000000
RDX: 1ffffffff412f978 RSI: ffffffff8a0e0579 RDI: 0000000000000007
RBP: ffffffffa097cbc2 R08: 0000000000000007 R09: fffffffffffff000
R10: ffffffffa097cbc2 R11: ffffffff8a40008b R12: ffffffff8e8df270
R13: dffffc0000000000 R14: ffffc900038f74d0 R15: ffffc900038f74d8
FS:  0000555556e67380(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: fffffbfff412f978 CR3: 000000007ab37000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	89 c6                	mov    %eax,%esi
   2:	e8 39 16 78 f7       	call   0xf7781640
   7:	48 81 fd 00 f0 ff ff 	cmp    $0xfffffffffffff000,%rbp
   e:	0f 87 5b 02 00 00    	ja     0x26f
  14:	e8 97 1a 78 f7       	call   0xf7781ab0
  19:	48 89 ea             	mov    %rbp,%rdx
  1c:	48 b8 00 00 00 00 00 	movabs $0xdffffc0000000000,%rax
  23:	fc ff df
  26:	48 c1 ea 03          	shr    $0x3,%rdx
* 2a:	80 3c 02 00          	cmpb   $0x0,(%rdx,%rax,1) <-- trapping instruction
  2e:	0f 85 11 03 00 00    	jne    0x345
  34:	48 8d 7d 10          	lea    0x10(%rbp),%rdi
  38:	48 8b 75 00          	mov    0x0(%rbp),%rsi
  3c:	48                   	rex.W
  3d:	b8                   	.byte 0xb8

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/08/10 22:27 net-next 29afcd69672a 4df3089c .config strace log report syz C ci-upstream-net-kasan-gce BUG: unable to handle kernel paging request in ovs_vport_add
2023/08/10 21:40 net-next 29afcd69672a 4df3089c .config console log report info ci-upstream-net-kasan-gce BUG: unable to handle kernel paging request in ovs_vport_add
* Struck through repros no longer work on HEAD.