syzbot


divide error in nf_nat_l4proto_unique_tuple

Status: fixed on 2018/02/26 20:04
Subsystems: netfilter
[Documentation on labels]
Reported-by: syzbot+8012e198bd037f4871e5@syzkaller.appspotmail.com
Fix commit: db57ccf0f2f4 netfilter: nat: cope with negative port range
First crash: 2435d, last: 2435d
Discussions (13)
Title Replies (including bot) Last reply
[PATCH 3.16 000/410] 3.16.57-rc1 review 426 (426) 2018/11/12 17:42
[PATCH 3.2 000/153] 3.2.102-rc1 review 155 (155) 2018/05/30 22:14
[PATCH 4.4 00/63] 4.4.122-stable review 79 (79) 2018/04/06 07:51
[PATCH 4.9 00/86] 4.9.88-stable review 97 (97) 2018/03/22 17:47
[PATCH 3.18 00/25] 3.18.100-stable review 30 (30) 2018/03/18 10:14
[PATCH 4.15 000/146] 4.15.10-stable review 160 (160) 2018/03/15 10:19
[PATCH 4.14 000/140] 4.14.27-stable review 150 (150) 2018/03/14 18:26
[PATCH 00/19] Netfilter fixes for net 21 (21) 2018/02/21 19:56
[PATCH net v3] netfilter: nat: cope with negative port range 2 (2) 2018/02/14 19:55
[PATCH net v2] netfilter: nat: cope with negative port range 7 (7) 2018/02/14 15:49
[PATCH net] netfilter: nat: cope with negative port range 3 (3) 2018/02/13 17:22
[PATCH nf] netfilter: nf_nat: range size must be at least 1 1 (1) 2018/02/13 00:45
divide error in nf_nat_l4proto_unique_tuple 0 (1) 2018/02/12 17:25

Sample crash report:
divide error: 0000 [#1] SMP KASAN
Dumping ftrace buffer:
   (ftrace buffer empty)
Modules linked in:
CPU: 1 PID: 4168 Comm: syzkaller034710 Not tainted 4.16.0-rc1+ #309
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:nf_nat_l4proto_unique_tuple+0x291/0x530 net/netfilter/nf_nat_proto_common.c:88
RSP: 0018:ffff8801b2466778 EFLAGS: 00010246
RAX: 000000000000f153 RBX: ffff8801b2466dd8 RCX: ffff8801b2466c7c
RDX: 0000000000000000 RSI: ffff8801b2466c58 RDI: ffff8801db5293ac
RBP: ffff8801b24667d8 R08: ffff8801b8ba6dc0 R09: ffffffff88af5900
R10: ffff8801b24666f0 R11: 0000000000000000 R12: 000000002990f153
R13: 0000000000000001 R14: 0000000000000000 R15: ffff8801b2466c7c
FS:  00000000017e3880(0000) GS:ffff8801db500000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000208fdfe4 CR3: 00000001b5340002 CR4: 00000000001606e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 dccp_unique_tuple+0x40/0x50 net/netfilter/nf_nat_proto_dccp.c:30
 get_unique_tuple+0xc28/0x1c10 net/netfilter/nf_nat_core.c:362
 nf_nat_setup_info+0x1c2/0xe00 net/netfilter/nf_nat_core.c:406
 nf_nat_redirect_ipv6+0x306/0x730 net/netfilter/nf_nat_redirect.c:124
 redirect_tg6+0x7f/0xb0 net/netfilter/xt_REDIRECT.c:34
 ip6t_do_table+0xc2a/0x1a30 net/ipv6/netfilter/ip6_tables.c:365
 ip6table_nat_do_chain+0x65/0x80 net/ipv6/netfilter/ip6table_nat.c:41
 nf_nat_ipv6_fn+0x594/0xa80 net/ipv6/netfilter/nf_nat_l3proto_ipv6.c:302
 nf_nat_ipv6_local_fn+0x33/0x5d0 net/ipv6/netfilter/nf_nat_l3proto_ipv6.c:407
 ip6table_nat_local_fn+0x2c/0x40 net/ipv6/netfilter/ip6table_nat.c:69
 nf_hook_entry_hookfn include/linux/netfilter.h:120 [inline]
 nf_hook_slow+0xba/0x1a0 net/netfilter/core.c:483
 nf_hook include/linux/netfilter.h:243 [inline]
 NF_HOOK include/linux/netfilter.h:286 [inline]
 ip6_xmit+0x10ec/0x2260 net/ipv6/ip6_output.c:277
 inet6_csk_xmit+0x2fc/0x580 net/ipv6/inet6_connection_sock.c:139
 dccp_transmit_skb+0x9ac/0x10f0 net/dccp/output.c:142
 dccp_connect+0x369/0x670 net/dccp/output.c:564
 dccp_v6_connect+0xe17/0x1bf0 net/dccp/ipv6.c:946
 __inet_stream_connect+0x2d4/0xf00 net/ipv4/af_inet.c:620
 inet_stream_connect+0x58/0xa0 net/ipv4/af_inet.c:684
 SYSC_connect+0x213/0x4a0 net/socket.c:1639
 SyS_connect+0x24/0x30 net/socket.c:1620
 do_syscall_64+0x282/0x940 arch/x86/entry/common.c:287
 entry_SYSCALL_64_after_hwframe+0x26/0x9b
RIP: 0033:0x441c69
RSP: 002b:00007ffe50cc0be8 EFLAGS: 00000217 ORIG_RAX: 000000000000002a
RAX: ffffffffffffffda RBX: ffffffffffffffff RCX: 0000000000441c69
RDX: 000000000000001c RSI: 00000000208fdfe4 RDI: 0000000000000003
RBP: 00000000006cc018 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000538 R11: 0000000000000217 R12: 0000000000403590
R13: 0000000000403620 R14: 0000000000000000 R15: 0000000000000000
Code: 48 89 f0 83 e0 07 83 c0 01 38 d0 7c 08 84 d2 0f 85 46 02 00 00 48 8b 45 c8 44 0f b7 20 e8 88 97 04 fd 31 d2 41 0f b7 c4 4c 89 f9 <41> f7 f6 48 c1 e9 03 48 b8 00 00 00 00 00 fc ff df 0f b6 0c 01 
RIP: nf_nat_l4proto_unique_tuple+0x291/0x530 net/netfilter/nf_nat_proto_common.c:88 RSP: ffff8801b2466778
---[ end trace ac43c2e7af4625cd ]---

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/02/12 08:21 upstream 7928b2cbe55b 4e9b726d .config console log report syz C ci-upstream-kasan-gce
2018/02/12 09:26 net-next-old 9a61df9e5f74 4e9b726d .config console log report syz C ci-upstream-net-kasan-gce
* Struck through repros no longer work on HEAD.