syzbot


general protection fault in nf_tables_dump_tables
Status: fixed on 2022/03/08 16:10
Reported-by: syzbot+0e3358e5ebb1956c271d@syzkaller.appspotmail.com
Fix commit: a499b03bf36b netfilter: nf_tables: unlink table before deleting it
First crash: 244d, last: 244d

Cause bisection: introduced by (bisect log) :
commit 6001a930ce0378b62210d4f83583fc88a903d89d
Author: Pablo Neira Ayuso <pablo@netfilter.org>
Date: Mon Feb 15 11:28:07 2021 +0000

  netfilter: nftables: introduce table ownership

Crash: general protection fault in nf_tables_dump_tables (log)
Repro: syz .config

Fix bisection: fixed by (bisect log) :
commit a499b03bf36b0c2e3b958a381d828678ab0ffc5e
Author: Florian Westphal <fw@strlen.de>
Date: Mon Sep 13 12:42:33 2021 +0000

  netfilter: nf_tables: unlink table before deleting it


Sample crash report:
general protection fault, probably for non-canonical address 0xfbd59c0000000058: 0000 [#1] PREEMPT SMP KASAN
KASAN: maybe wild-memory-access in range [0xdead0000000002c0-0xdead0000000002c7]
CPU: 0 PID: 14725 Comm: syz-executor.0 Not tainted 5.15.0-rc2-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:nf_tables_dump_tables+0x343/0xa50 net/netfilter/nf_tables_api.c:822
Code: 44 24 30 e8 8f 46 08 fa 31 ff 44 89 ee e8 c5 4d 08 fa 45 85 ed 74 4c e8 7b 46 08 fa 48 8d bb c4 01 00 00 48 89 f8 48 c1 e8 03 <0f> b6 14 28 48 89 f8 83 e0 07 83 c0 01 38 d0 7c 08 84 d2 0f 85 cd
RSP: 0018:ffffc900056af220 EFLAGS: 00010a03
RAX: 1bd5a00000000058 RBX: dead000000000100 RCX: 0000000000000000
RDX: ffff88801ed8d580 RSI: ffffffff876dc545 RDI: dead0000000002c4
RBP: dffffc0000000000 R08: 0000000000000000 R09: ffff88807f0d4043
R10: ffffffff876dc53b R11: 0000000000000000 R12: 0000000000000001
R13: 0000000000000002 R14: 0000000000001128 R15: 0000000000000000
FS:  00007f265f328700(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055dd3a5fd7b0 CR3: 000000001aa29000 CR4: 00000000001506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 netlink_dump+0x4b9/0xb70 net/netlink/af_netlink.c:2278
 __netlink_dump_start+0x642/0x900 net/netlink/af_netlink.c:2383
 netlink_dump_start include/linux/netlink.h:258 [inline]
 nft_netlink_dump_start_rcu+0x83/0x1c0 net/netfilter/nf_tables_api.c:859
 nf_tables_gettable+0x47d/0x570 net/netfilter/nf_tables_api.c:884
 nfnetlink_rcv_msg+0x659/0x13f0 net/netfilter/nfnetlink.c:285
 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2504
 nfnetlink_rcv+0x1ac/0x420 net/netfilter/nfnetlink.c:654
 netlink_unicast_kernel net/netlink/af_netlink.c:1314 [inline]
 netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1340
 netlink_sendmsg+0x86d/0xdb0 net/netlink/af_netlink.c:1929
 sock_sendmsg_nosec net/socket.c:704 [inline]
 sock_sendmsg+0xcf/0x120 net/socket.c:724
 ____sys_sendmsg+0x6e8/0x810 net/socket.c:2409
 ___sys_sendmsg+0xf3/0x170 net/socket.c:2463
 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2492
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7f265fbb1709
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:00007f265f328188 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00007f265fcb5f60 RCX: 00007f265fbb1709
RDX: 0000000000000000 RSI: 0000000020000380 RDI: 0000000000000004
RBP: 00007f265fc0bcb4 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffd8d81b01f R14: 00007f265f328300 R15: 0000000000022000
Modules linked in:
---[ end trace 7f3ecc9b411143c8 ]---
RIP: 0010:nf_tables_dump_tables+0x343/0xa50 net/netfilter/nf_tables_api.c:822
Code: 44 24 30 e8 8f 46 08 fa 31 ff 44 89 ee e8 c5 4d 08 fa 45 85 ed 74 4c e8 7b 46 08 fa 48 8d bb c4 01 00 00 48 89 f8 48 c1 e8 03 <0f> b6 14 28 48 89 f8 83 e0 07 83 c0 01 38 d0 7c 08 84 d2 0f 85 cd
RSP: 0018:ffffc900056af220 EFLAGS: 00010a03
RAX: 1bd5a00000000058 RBX: dead000000000100 RCX: 0000000000000000
RDX: ffff88801ed8d580 RSI: ffffffff876dc545 RDI: dead0000000002c4
RBP: dffffc0000000000 R08: 0000000000000000 R09: ffff88807f0d4043
R10: ffffffff876dc53b R11: 0000000000000000 R12: 0000000000000001
R13: 0000000000000002 R14: 0000000000001128 R15: 0000000000000000
FS:  00007f265f328700(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055dd3a5baa50 CR3: 000000001aa29000 CR4: 00000000001506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	44 24 30             	rex.R and $0x30,%al
   3:	e8 8f 46 08 fa       	callq  0xfa084697
   8:	31 ff                	xor    %edi,%edi
   a:	44 89 ee             	mov    %r13d,%esi
   d:	e8 c5 4d 08 fa       	callq  0xfa084dd7
  12:	45 85 ed             	test   %r13d,%r13d
  15:	74 4c                	je     0x63
  17:	e8 7b 46 08 fa       	callq  0xfa084697
  1c:	48 8d bb c4 01 00 00 	lea    0x1c4(%rbx),%rdi
  23:	48 89 f8             	mov    %rdi,%rax
  26:	48 c1 e8 03          	shr    $0x3,%rax
* 2a:	0f b6 14 28          	movzbl (%rax,%rbp,1),%edx <-- trapping instruction
  2e:	48 89 f8             	mov    %rdi,%rax
  31:	83 e0 07             	and    $0x7,%eax
  34:	83 c0 01             	add    $0x1,%eax
  37:	38 d0                	cmp    %dl,%al
  39:	7c 08                	jl     0x43
  3b:	84 d2                	test   %dl,%dl
  3d:	0f                   	.byte 0xf
  3e:	85 cd                	test   %ecx,%ebp

Crashes (4):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-net-this-kasan-gce 2021/09/24 15:15 net 9bc62afe03af 8cac236e .config log report syz general protection fault in nf_tables_dump_tables
ci-upstream-net-kasan-gce 2021/09/24 20:40 net-next acde891c243c 8cac236e .config log report syz general protection fault in nf_tables_dump_tables
ci-upstream-net-kasan-gce 2021/09/24 13:36 net-next 2fcd14d0f780 8cac236e .config log report syz general protection fault in nf_tables_dump_tables
ci-upstream-kasan-gce 2021/09/24 12:15 upstream f9e36107ec70 8cac236e .config log report info general protection fault in nf_tables_dump_tables