syzbot


general protection fault in nf_nat_setup_info

Status: fixed on 2020/10/31 10:09
Reported-by: syzbot+e9ebb7c4f8359696c15b@syzkaller.appspotmail.com
Fix commit: 289fe546ea16 netfilter: ctnetlink: add a range check for l3/l4 protonum
First crash: 1605d, last: 1514d
Fix bisection: fixed by (bisect log) :
commit 289fe546ea16c2dcb57c5198c5a7b7387604530e
Author: Will McVicker <willmcvicker@google.com>
Date: Mon Aug 24 19:38:32 2020 +0000

  netfilter: ctnetlink: add a range check for l3/l4 protonum

  
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 general protection fault in nf_nat_setup_info C error 3 1533d 1578d 0/1 upstream: reported C repro on 2020/07/28 11:16
Fix bisection attempts (2)
Created Duration User Patch Repo Result
2020/10/31 01:10 3h00m bisect fix linux-4.19.y OK (1) job log
2020/10/01 00:43 26m bisect fix linux-4.19.y OK (0) job log log

Sample crash report:
audit: type=1400 audit(1597285610.897:8): avc:  denied  { execmem } for  pid=6475 comm="syz-executor688" scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=process permissive=1
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
CPU: 0 PID: 6475 Comm: syz-executor688 Not tainted 4.19.139-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:__read_once_size include/linux/compiler.h:193 [inline]
RIP: 0010:__nf_nat_l4proto_find net/netfilter/nf_nat_core.c:73 [inline]
RIP: 0010:get_unique_tuple net/netfilter/nf_nat_core.c:336 [inline]
RIP: 0010:nf_nat_setup_info+0x2f6/0x1f20 net/netfilter/nf_nat_core.c:431
Code: c1 ea 03 80 3c 02 00 0f 85 60 19 00 00 4a 8b 04 e5 60 53 af 89 48 8d 1c d8 48 b8 00 00 00 00 00 fc ff df 48 89 da 48 c1 ea 03 <80> 3c 02 00 0f 85 2c 19 00 00 48 8b 03 48 89 85 48 fe ff ff e8 f1
RSP: 0018:ffff8880a50e6ed0 EFLAGS: 00010246
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffffff85ee39cd
RDX: 0000000000000000 RSI: ffffffff85ee2eb7 RDI: ffffffff89af5420
RBP: ffff8880a50e70b0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000005 R11: 0000000000000000 R12: 0000000000000018
R13: ffff8880a50e6f70 R14: ffff8880a9443500 R15: 0000000000000000
FS:  0000000000975880(0000) GS:ffff8880ae600000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020000606 CR3: 000000008dd49000 CR4: 00000000001406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 __nf_nat_alloc_null_binding+0x164/0x1d0 net/netfilter/nf_nat_core.c:490
 nfnetlink_parse_nat_setup+0x53a/0x640 net/netfilter/nf_nat_core.c:882
 ctnetlink_parse_nat_setup+0xb6/0x640 net/netfilter/nf_conntrack_netlink.c:1521
 ctnetlink_setup_nat net/netfilter/nf_conntrack_netlink.c:1591 [inline]
 ctnetlink_create_conntrack+0x4bb/0x12c0 net/netfilter/nf_conntrack_netlink.c:1984
 ctnetlink_new_conntrack+0x4f3/0xde0 net/netfilter/nf_conntrack_netlink.c:2114
 nfnetlink_rcv_msg+0xc4f/0xf60 net/netfilter/nfnetlink.c:228
 netlink_rcv_skb+0x160/0x440 net/netlink/af_netlink.c:2455
 nfnetlink_rcv+0x1b2/0x41b net/netfilter/nfnetlink.c:560
 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline]
 netlink_unicast+0x4d5/0x690 net/netlink/af_netlink.c:1344
 netlink_sendmsg+0x6bb/0xc40 net/netlink/af_netlink.c:1909
 sock_sendmsg_nosec net/socket.c:622 [inline]
 sock_sendmsg+0xc3/0x120 net/socket.c:632
 ___sys_sendmsg+0x7bb/0x8e0 net/socket.c:2115
 __sys_sendmsg net/socket.c:2153 [inline]
 __do_sys_sendmsg net/socket.c:2162 [inline]
 __se_sys_sendmsg net/socket.c:2160 [inline]
 __x64_sys_sendmsg+0x132/0x220 net/socket.c:2160
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x440629
Code: 18 89 d0 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 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 0f 83 7b 13 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fffd0ae4118 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 0000000000440629
RDX: 0000000000000000 RSI: 0000000020000300 RDI: 0000000000000003
RBP: 00000000006ca018 R08: 0000000000000008 R09: 00000000004002c8
R10: 0000000000000014 R11: 0000000000000246 R12: 0000000000401e30
R13: 0000000000401ec0 R14: 0000000000000000 R15: 0000000000000000
Modules linked in:
---[ end trace 9231cd5f4216cf31 ]---
RIP: 0010:__read_once_size include/linux/compiler.h:193 [inline]
RIP: 0010:__nf_nat_l4proto_find net/netfilter/nf_nat_core.c:73 [inline]
RIP: 0010:get_unique_tuple net/netfilter/nf_nat_core.c:336 [inline]
RIP: 0010:nf_nat_setup_info+0x2f6/0x1f20 net/netfilter/nf_nat_core.c:431
Code: c1 ea 03 80 3c 02 00 0f 85 60 19 00 00 4a 8b 04 e5 60 53 af 89 48 8d 1c d8 48 b8 00 00 00 00 00 fc ff df 48 89 da 48 c1 ea 03 <80> 3c 02 00 0f 85 2c 19 00 00 48 8b 03 48 89 85 48 fe ff ff e8 f1
RSP: 0018:ffff8880a50e6ed0 EFLAGS: 00010246
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffffff85ee39cd
RDX: 0000000000000000 RSI: ffffffff85ee2eb7 RDI: ffffffff89af5420
RBP: ffff8880a50e70b0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000005 R11: 0000000000000000 R12: 0000000000000018
R13: ffff8880a50e6f70 R14: ffff8880a9443500 R15: 0000000000000000
FS:  0000000000975880(0000) GS:ffff8880ae600000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020000606 CR3: 000000008dd49000 CR4: 00000000001406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (22):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/08/13 02:28 linux-4.19.y c14d30dc9987 bc15f7db .config console log report syz C ci2-linux-4-19
2020/07/01 17:50 linux-4.19.y 399849e4654e 39acb39d .config console log report syz C ci2-linux-4-19
2020/09/01 00:43 linux-4.19.y f6d5cb9e2c06 d5a3ae1f .config console log report ci2-linux-4-19
2020/08/31 11:23 linux-4.19.y f6d5cb9e2c06 d5a3ae1f .config console log report ci2-linux-4-19
2020/08/23 08:19 linux-4.19.y d18b78abc0c6 1da71ab0 .config console log report ci2-linux-4-19
2020/08/20 23:41 linux-4.19.y a834132bd465 70160577 .config console log report ci2-linux-4-19
2020/08/17 23:27 linux-4.19.y c14d30dc9987 5ce13532 .config console log report ci2-linux-4-19
2020/08/16 00:11 linux-4.19.y c14d30dc9987 5ce13532 .config console log report ci2-linux-4-19
2020/08/05 18:16 linux-4.19.y c076c79e03c6 b7129355 .config console log report ci2-linux-4-19
2020/08/03 21:12 linux-4.19.y 13af6c74b14a 96dd3623 .config console log report ci2-linux-4-19
2020/08/01 02:07 linux-4.19.y 13af6c74b14a 8df85ed9 .config console log report ci2-linux-4-19
2020/07/31 12:04 linux-4.19.y 205a42ce2861 8df85ed9 .config console log report ci2-linux-4-19
2020/07/29 04:31 linux-4.19.y 20b3a3dfdf6c cb93dc6a .config console log report ci2-linux-4-19
2020/07/27 03:16 linux-4.19.y 20b3a3dfdf6c 51265195 .config console log report ci2-linux-4-19
2020/07/24 18:20 linux-4.19.y 20b3a3dfdf6c 554af388 .config console log report ci2-linux-4-19
2020/07/19 06:24 linux-4.19.y 17a87580a885 9c812472 .config console log report ci2-linux-4-19
2020/07/19 00:58 linux-4.19.y 17a87580a885 9c812472 .config console log report ci2-linux-4-19
2020/07/18 00:21 linux-4.19.y 17a87580a885 9c812472 .config console log report ci2-linux-4-19
2020/07/17 23:10 linux-4.19.y 17a87580a885 9c812472 .config console log report ci2-linux-4-19
2020/07/07 02:09 linux-4.19.y 399849e4654e ef278c73 .config console log report ci2-linux-4-19
2020/07/05 10:14 linux-4.19.y 399849e4654e 24d7f505 .config console log report ci2-linux-4-19
2020/07/04 23:18 linux-4.19.y 399849e4654e 4f739670 .config console log report ci2-linux-4-19
* Struck through repros no longer work on HEAD.