2018-02-23 17:01:05

by syzbot

[permalink] [raw]
Subject: general protection fault in kernel_sock_shutdown

Hello,

syzbot hit the following crash on upstream commit
af3e79d29555b97dd096e2f8e36a0f50213808a8 (Tue Feb 20 18:05:02 2018 +0000)
Merge tag 'leds_for-4.16-rc3' of
git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds

So far this crash happened 15 times on
https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git/master,
net-next.
C reproducer is attached.
syzkaller reproducer is attached.
Raw console output is attached.
compiler: gcc (GCC) 7.1.1 20170620
.config is attached.

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: [email protected]
It will help syzbot understand when the bug is fixed. See footer for
details.
If you forward the report, please keep this part and the footer.

audit: type=1400 audit(1519334784.255:7): avc: denied { map } for
pid=4107 comm="syzkaller141165" path="/root/syzkaller141165324" dev="sda1"
ino=16481 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] SMP KASAN
Dumping ftrace buffer:
(ftrace buffer empty)
Modules linked in:
CPU: 0 PID: 4107 Comm: syzkaller141165 Not tainted 4.16.0-rc2+ #324
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
RIP: 0010:kernel_sock_shutdown+0x29/0x70 net/socket.c:3250
RSP: 0018:ffff8801c905fcc8 EFLAGS: 00010206
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffffff846006f4
RDX: 0000000000000005 RSI: 0000000000000002 RDI: 0000000000000028
RBP: ffff8801c905fce0 R08: 0000000000000000 R09: 1ffff1003920bf15
R10: ffff8801c905f870 R11: 0000000000000001 R12: ffff8801c90267d2
R13: 0000000000000002 R14: 0000000000000000 R15: ffff8801c905fd58
FS: 00000000006e6880(0000) GS:ffff8801db200000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fc70e02f000 CR3: 00000001ca694005 CR4: 00000000001606f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
smc_shutdown+0x3ed/0x540 net/smc/af_smc.c:1268
SYSC_shutdown net/socket.c:1901 [inline]
SyS_shutdown+0x137/0x290 net/socket.c:1892
do_syscall_64+0x280/0x940 arch/x86/entry/common.c:287
entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x43fcb9
RSP: 002b:00007ffde8479798 EFLAGS: 00000217 ORIG_RAX: 0000000000000030
RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 000000000043fcb9
RDX: 000000000043fcb9 RSI: 0000000000000002 RDI: 0000000000000003
RBP: 00000000006ca018 R08: 00000000004002c8 R09: 00000000004002c8
R10: 00000000004002c8 R11: 0000000000000217 R12: 00000000004015e0
R13: 0000000000401670 R14: 0000000000000000 R15: 0000000000000000
Code: 66 90 55 48 89 e5 41 55 41 54 53 48 89 fb 41 89 f5 e8 dc 04 11 fd 48
8d 7b 28 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80> 3c 02 00
75 32 4c 8b 63 28 48 b8 00 00 00 00 00 fc ff df 49
RIP: kernel_sock_shutdown+0x29/0x70 net/socket.c:3250 RSP: ffff8801c905fcc8
---[ end trace 187d9b346b4a5aff ]---
Kernel panic - not syncing: Fatal exception
Dumping ftrace buffer:
(ftrace buffer empty)
Kernel Offset: disabled
Rebooting in 86400 seconds..


---
This bug is generated by a dumb bot. It may contain errors.
See https://goo.gl/tpsmEJ for details.
Direct all questions to [email protected].

syzbot will keep track of this bug report.
If you forgot to add the Reported-by tag, once the fix for this bug is
merged
into any tree, please reply to this email with:
#syz fix: exact-commit-title
If you want to test a patch for this bug, please reply with:
#syz test: git://repo/address.git branch
and provide the patch inline or as an attachment.
To mark this as a duplicate of another syzbot report, please reply with:
#syz dup: exact-subject-of-another-report
If it's a one-off invalid bug report, please reply with:
#syz invalid
Note: if the crash happens again, it will cause creation of a new bug
report.
Note: all commands must start from beginning of the line in the email body.


Attachments:
raw.log.txt (4.59 kB)
repro.syz.txt (347.00 B)
repro.c.txt (468.00 B)
config.txt (134.21 kB)
Download all attachments

2018-07-04 19:20:49

by Eric Biggers

[permalink] [raw]
Subject: Re: general protection fault in kernel_sock_shutdown

On Fri, Feb 23, 2018 at 08:59:01AM -0800, syzbot wrote:
> Hello,
>
> syzbot hit the following crash on upstream commit
> af3e79d29555b97dd096e2f8e36a0f50213808a8 (Tue Feb 20 18:05:02 2018 +0000)
> Merge tag 'leds_for-4.16-rc3' of
> git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds
>
> So far this crash happened 15 times on
> https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git/master,
> net-next.
> C reproducer is attached.
> syzkaller reproducer is attached.
> Raw console output is attached.
> compiler: gcc (GCC) 7.1.1 20170620
> .config is attached.
>
> IMPORTANT: if you fix the bug, please add the following tag to the commit:
> Reported-by: [email protected]
> It will help syzbot understand when the bug is fixed. See footer for
> details.
> If you forward the report, please keep this part and the footer.
>
> audit: type=1400 audit(1519334784.255:7): avc: denied { map } for
> pid=4107 comm="syzkaller141165" path="/root/syzkaller141165324" dev="sda1"
> ino=16481 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] SMP KASAN
> Dumping ftrace buffer:
> (ftrace buffer empty)
> Modules linked in:
> CPU: 0 PID: 4107 Comm: syzkaller141165 Not tainted 4.16.0-rc2+ #324
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
> Google 01/01/2011
> RIP: 0010:kernel_sock_shutdown+0x29/0x70 net/socket.c:3250
> RSP: 0018:ffff8801c905fcc8 EFLAGS: 00010206
> RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffffff846006f4
> RDX: 0000000000000005 RSI: 0000000000000002 RDI: 0000000000000028
> RBP: ffff8801c905fce0 R08: 0000000000000000 R09: 1ffff1003920bf15
> R10: ffff8801c905f870 R11: 0000000000000001 R12: ffff8801c90267d2
> R13: 0000000000000002 R14: 0000000000000000 R15: ffff8801c905fd58
> FS: 00000000006e6880(0000) GS:ffff8801db200000(0000) knlGS:0000000000000000
> CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> CR2: 00007fc70e02f000 CR3: 00000001ca694005 CR4: 00000000001606f0
> DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
> Call Trace:
> smc_shutdown+0x3ed/0x540 net/smc/af_smc.c:1268
> SYSC_shutdown net/socket.c:1901 [inline]
> SyS_shutdown+0x137/0x290 net/socket.c:1892
> do_syscall_64+0x280/0x940 arch/x86/entry/common.c:287
> entry_SYSCALL_64_after_hwframe+0x42/0xb7
> RIP: 0033:0x43fcb9
> RSP: 002b:00007ffde8479798 EFLAGS: 00000217 ORIG_RAX: 0000000000000030
> RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 000000000043fcb9
> RDX: 000000000043fcb9 RSI: 0000000000000002 RDI: 0000000000000003
> RBP: 00000000006ca018 R08: 00000000004002c8 R09: 00000000004002c8
> R10: 00000000004002c8 R11: 0000000000000217 R12: 00000000004015e0
> R13: 0000000000401670 R14: 0000000000000000 R15: 0000000000000000
> Code: 66 90 55 48 89 e5 41 55 41 54 53 48 89 fb 41 89 f5 e8 dc 04 11 fd 48
> 8d 7b 28 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80> 3c 02 00 75
> 32 4c 8b 63 28 48 b8 00 00 00 00 00 fc ff df 49
> RIP: kernel_sock_shutdown+0x29/0x70 net/socket.c:3250 RSP: ffff8801c905fcc8
> ---[ end trace 187d9b346b4a5aff ]---
> Kernel panic - not syncing: Fatal exception
> Dumping ftrace buffer:
> (ftrace buffer empty)
> Kernel Offset: disabled
> Rebooting in 86400 seconds..
>
>
> ---
> This bug is generated by a dumb bot. It may contain errors.
> See https://goo.gl/tpsmEJ for details.
> Direct all questions to [email protected].
>
> syzbot will keep track of this bug report.
> If you forgot to add the Reported-by tag, once the fix for this bug is
> merged
> into any tree, please reply to this email with:
> #syz fix: exact-commit-title

This was fixed by commit 1255fcb2a655f0:

#syz fix: net/smc: fix shutdown in state SMC_LISTEN

This also had been reported here: https://bugzilla.kernel.org/show_bug.cgi?id=199429

- Eric