general protection fault in xt_rateest_put

4 views
Skip to first unread message

syzbot

unread,
Jan 16, 2020, 2:01:11 AM1/16/20
to syzkaller...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: db5b9190 Linux 4.19.96
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1586e421e00000
kernel config: https://syzkaller.appspot.com/x/.config?x=7a24894346f71303
dashboard link: https://syzkaller.appspot.com/bug?extid=7d250d19d32e991912c8
compiler: gcc (GCC) 9.0.0 20181231 (experimental)

Unfortunately, I don't have any reproducer for this crash yet.

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+7d250d...@syzkaller.appspotmail.com

XFS (loop0): SB validate failed with error -117.
EXT4-fs warning (device sda1): verify_group_input:104: Cannot add at group
511 (only 16 groups)
kasan: GPF could be caused by NULL-ptr deref or user memory access
general protection fault: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 15430 Comm: syz-executor.1 Not tainted 4.19.96-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:net_generic include/net/netns/generic.h:45 [inline]
RIP: 0010:xt_rateest_put+0xa1/0x440 net/netfilter/xt_RATEEST.c:80
Code: 65 6f 61 fb 45 84 f6 0f 84 ab 02 00 00 e8 17 6e 61 fb 49 8d bd 48 1b
00 00 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f
85 67 03 00 00 4d 8b b5 48 1b 00 00 e8 d9 7e 4e fb
RSP: 0018:ffff88804989f988 EFLAGS: 00010206
RAX: dffffc0000000000 RBX: ffff888090530500 RCX: ffffc90011501000
RDX: 0000000000000369 RSI: ffffffff8609a7a9 RDI: 0000000000001b48
RBP: ffff88804989f9b8 R08: ffff88804b3f0240 R09: ffffed1015d04733
R10: ffffed1015d04732 R11: ffff8880ae823993 R12: 000000000000002c
R13: 0000000000000000 R14: 0000000000000001 R15: ffffffff8609ab60
FS: 00007f3f61852700(0000) GS:ffff8880ae800000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f1195d5fdb8 CR3: 000000008f250000 CR4: 00000000001406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
xt_rateest_tg_destroy+0x72/0xa0 net/netfilter/xt_RATEEST.c:178
cleanup_entry net/ipv4/netfilter/arp_tables.c:508 [inline]
translate_table+0x11f4/0x1d80 net/ipv4/netfilter/arp_tables.c:586
do_replace net/ipv4/netfilter/arp_tables.c:980 [inline]
do_arpt_set_ctl+0x30a/0x640 net/ipv4/netfilter/arp_tables.c:1460
nf_sockopt net/netfilter/nf_sockopt.c:106 [inline]
nf_setsockopt+0x77/0xd0 net/netfilter/nf_sockopt.c:115
ip_setsockopt net/ipv4/ip_sockglue.c:1258 [inline]
ip_setsockopt+0xdf/0x100 net/ipv4/ip_sockglue.c:1238
udp_setsockopt+0x68/0xb0 net/ipv4/udp.c:2548
sock_common_setsockopt+0x94/0xd0 net/core/sock.c:3046
__sys_setsockopt+0x17a/0x280 net/socket.c:1901
__do_sys_setsockopt net/socket.c:1912 [inline]
__se_sys_setsockopt net/socket.c:1909 [inline]
__x64_sys_setsockopt+0xbe/0x150 net/socket.c:1909
do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x45aff9
Code: ad b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 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 b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f3f61851c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000036
RAX: ffffffffffffffda RBX: 00007f3f618526d4 RCX: 000000000045aff9
RDX: 0000000000000060 RSI: 0a02000000000000 RDI: 0000000000000003
RBP: 000000000075bf20 R08: 0000000000000430 R09: 0000000000000000
R10: 00000000200008c0 R11: 0000000000000246 R12: 00000000ffffffff
R13: 00000000000009b5 R14: 00000000004d3770 R15: 000000000075bf2c
Modules linked in:
---[ end trace 1e9e22c0611942b5 ]---
RIP: 0010:__read_once_size include/linux/compiler.h:193 [inline]
RIP: 0010:net_generic include/net/netns/generic.h:45 [inline]
RIP: 0010:xt_rateest_put+0xa1/0x440 net/netfilter/xt_RATEEST.c:80
Code: 65 6f 61 fb 45 84 f6 0f 84 ab 02 00 00 e8 17 6e 61 fb 49 8d bd 48 1b
00 00 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f
85 67 03 00 00 4d 8b b5 48 1b 00 00 e8 d9 7e 4e fb
XFS (loop0): SB sanity check failed
EXT4-fs warning (device sda1): verify_group_input:104: Cannot add at group
511 (only 16 groups)
XFS (loop0): Metadata corruption detected at xfs_sb_read_verify+0x440/0x570
fs/xfs/libxfs/xfs_sb.c:685, xfs_sb block 0xffffffffffffffff
RSP: 0018:ffff88804989f988 EFLAGS: 00010206
RAX: dffffc0000000000 RBX: ffff888090530500 RCX: ffffc90011501000
RDX: 0000000000000369 RSI: ffffffff8609a7a9 RDI: 0000000000001b48
XFS (loop0): Unmount and run xfs_repair
RBP: ffff88804989f9b8 R08: ffff88804b3f0240 R09: ffffed1015d04733
XFS (loop0): First 128 bytes of corrupted metadata buffer:
000000009359ff65: 58 46 53 42 00 00 10 00 00 00 00 00 00 00 10 00
XFSB............
R10: ffffed1015d04732 R11: ffff8880ae823993 R12: 000000000000002c
0000000086a19110: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 ................
0000000086a5b011: 98 4f 0b 50 42 b6 4b 06 bc 86 cb a3 e6 cc 3f
80 .O.PB.K.......?.
netlink: 'syz-executor.5': attribute type 3 has an invalid length.
EXT4-fs warning (device sda1): verify_group_input:104: Cannot add at group
511 (only 16 groups)
R13: 0000000000000000 R14: 0000000000000001 R15: ffffffff8609ab60
000000000ea56f30: 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00
80 ................
FS: 00007f3f61852700(0000) GS:ffff8880ae900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
00000000f54bd3e3: 00 00 f9 ff ff ff ff 80 00 00 00 00 00 00 00
82 ................
CR2: 00007ffe41e81d0c CR3: 000000008f250000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400


---
This bug is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this bug report. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

syzbot

unread,
Jan 16, 2020, 2:15:11 AM1/16/20
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following crash on:

HEAD commit: db5b9190 Linux 4.19.96
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=168b419ee00000
kernel config: https://syzkaller.appspot.com/x/.config?x=7a24894346f71303
dashboard link: https://syzkaller.appspot.com/bug?extid=7d250d19d32e991912c8
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=13306c21e00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=12ae2b3ee00000

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+7d250d...@syzkaller.appspotmail.com

audit: type=1400 audit(1579158683.036:35): avc: denied { map } for
pid=8064 comm="bash" path="/bin/bash" dev="sda1" ino=1457
scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023
tcontext=system_u:object_r:file_t:s0 tclass=file permissive=1
audit: type=1400 audit(1579158699.306:36): avc: denied { map } for
pid=8076 comm="syz-executor803" path="/root/syz-executor803801769"
dev="sda1" ino=1426 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023
tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file 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: 1 PID: 8076 Comm: syz-executor803 Not tainted 4.19.96-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:net_generic include/net/netns/generic.h:45 [inline]
RIP: 0010:xt_rateest_put+0xa1/0x440 net/netfilter/xt_RATEEST.c:80
Code: 65 6f 61 fb 45 84 f6 0f 84 ab 02 00 00 e8 17 6e 61 fb 49 8d bd 48 1b
00 00 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f
85 67 03 00 00 4d 8b b5 48 1b 00 00 e8 d9 7e 4e fb
RSP: 0018:ffff888086e1f988 EFLAGS: 00010206
RAX: dffffc0000000000 RBX: ffff8880a8380100 RCX: ffffffff8609aa65
RDX: 0000000000000369 RSI: ffffffff8609a7a9 RDI: 0000000000001b48
RBP: ffff888086e1f9b8 R08: ffff8880a6310600 R09: ffffed1015d24733
R10: ffffed1015d24732 R11: ffff8880ae923993 R12: 000000000000002c
R13: 0000000000000000 R14: 0000000000000001 R15: ffffffff8609ab60
FS: 0000000000e19880(0000) GS:ffff8880ae900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000559ab8ee8500 CR3: 000000008b83a000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
xt_rateest_tg_destroy+0x72/0xa0 net/netfilter/xt_RATEEST.c:178
cleanup_entry net/ipv4/netfilter/arp_tables.c:508 [inline]
translate_table+0x11f4/0x1d80 net/ipv4/netfilter/arp_tables.c:586
do_replace net/ipv4/netfilter/arp_tables.c:980 [inline]
do_arpt_set_ctl+0x30a/0x640 net/ipv4/netfilter/arp_tables.c:1460
nf_sockopt net/netfilter/nf_sockopt.c:106 [inline]
nf_setsockopt+0x77/0xd0 net/netfilter/nf_sockopt.c:115
ip_setsockopt net/ipv4/ip_sockglue.c:1258 [inline]
ip_setsockopt+0xdf/0x100 net/ipv4/ip_sockglue.c:1238
udp_setsockopt+0x68/0xb0 net/ipv4/udp.c:2548
sock_common_setsockopt+0x94/0xd0 net/core/sock.c:3046
__sys_setsockopt+0x17a/0x280 net/socket.c:1901
__do_sys_setsockopt net/socket.c:1912 [inline]
__se_sys_setsockopt net/socket.c:1909 [inline]
__x64_sys_setsockopt+0xbe/0x150 net/socket.c:1909
do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x4419a9
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 fb 13 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fffed4bac58 EFLAGS: 00000246 ORIG_RAX: 0000000000000036
RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 00000000004419a9
RDX: 0000000000000060 RSI: 0a02000000000000 RDI: 0000000000000003
RBP: 00000000006cc018 R08: 0000000000000430 R09: 00000000004002c8
R10: 00000000200008c0 R11: 0000000000000246 R12: 0000000000403230
R13: 00000000004032c0 R14: 0000000000000000 R15: 0000000000000000
Modules linked in:
---[ end trace 3be81a4d07fe8889 ]---
RIP: 0010:__read_once_size include/linux/compiler.h:193 [inline]
RIP: 0010:net_generic include/net/netns/generic.h:45 [inline]
RIP: 0010:xt_rateest_put+0xa1/0x440 net/netfilter/xt_RATEEST.c:80
Code: 65 6f 61 fb 45 84 f6 0f 84 ab 02 00 00 e8 17 6e 61 fb 49 8d bd 48 1b
00 00 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f
85 67 03 00 00 4d 8b b5 48 1b 00 00 e8 d9 7e 4e fb
RSP: 0018:ffff888086e1f988 EFLAGS: 00010206
RAX: dffffc0000000000 RBX: ffff8880a8380100 RCX: ffffffff8609aa65
RDX: 0000000000000369 RSI: ffffffff8609a7a9 RDI: 0000000000001b48
RBP: ffff888086e1f9b8 R08: ffff8880a6310600 R09: ffffed1015d24733
R10: ffffed1015d24732 R11: ffff8880ae923993 R12: 000000000000002c
R13: 0000000000000000 R14: 0000000000000001 R15: ffffffff8609ab60
FS: 0000000000e19880(0000) GS:ffff8880ae900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000559ab8ee8500 CR3: 000000008b83a000 CR4: 00000000001406e0

syzbot

unread,
Feb 17, 2020, 6:23:02 PM2/17/20
to syzkaller...@googlegroups.com
syzbot suspects this bug was fixed by commit:

commit e3282417b91c09af9e327238edfd11deb887b83a
Author: Florian Westphal <f...@strlen.de>
Date: Sat Jan 11 22:19:53 2020 +0000

netfilter: arp_tables: init netns pointer in xt_tgdtor_param struct

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=11557d6ee00000
start commit: db5b9190 Linux 4.19.96
git tree: linux-4.19.y
If the result looks correct, please mark the bug fixed by replying with:

#syz fix: netfilter: arp_tables: init netns pointer in xt_tgdtor_param struct

For information about bisection process see: https://goo.gl/tpsmEJ#bisection
Reply all
Reply to author
Forward
0 new messages