BUG: sleeping function called from invalid context at arch/x86/mm/fault.c:LINE

16 views
Skip to first unread message

syzbot

unread,
Nov 30, 2017, 2:55:03 PM11/30/17
to JBeu...@suse.com, h...@zytor.com, kirill....@linux.intel.com, ldu...@linux.vnet.ibm.com, linux-...@vger.kernel.org, lu...@kernel.org, mi...@redhat.com, ricardo.ne...@linux.intel.com, syzkall...@googlegroups.com, tg...@linutronix.de, x...@kernel.org
Hello,

syzkaller hit the following crash on
b9151761021e25c024a6670df4e7c43ffbab0e1d
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git/master
compiler: gcc (GCC) 7.1.1 20170620
.config is attached
Raw console output is attached.

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


netlink: 3 bytes leftover after parsing attributes in process
`syz-executor1'.
netlink: 8 bytes leftover after parsing attributes in process
`syz-executor6'.
BUG: sleeping function called from invalid context at
arch/x86/mm/fault.c:1372
in_atomic(): 0, irqs_disabled(): 1, pid: 22259, name: syz-executor7
2 locks held by syz-executor7/22259:
#0: (sk_lock-AF_ALG){+.+.}, at: [<0000000035a74818>] lock_sock
include/net/sock.h:1465 [inline]
#0: (sk_lock-AF_ALG){+.+.}, at: [<0000000035a74818>]
af_alg_wait_for_data+0x2f2/0x650 crypto/af_alg.c:768
#1: (&mm->mmap_sem){++++}, at: [<0000000044f840f2>]
__do_page_fault+0x32d/0xc90 arch/x86/mm/fault.c:1358
irq event stamp: 332
hardirqs last enabled at (331): [<00000000eed64b41>] slab_alloc
mm/slab.c:3378 [inline]
hardirqs last enabled at (331): [<00000000eed64b41>] __do_kmalloc
mm/slab.c:3709 [inline]
hardirqs last enabled at (331): [<00000000eed64b41>] __kmalloc+0x23a/0x760
mm/slab.c:3720
hardirqs last disabled at (332): [<00000000f3407c2d>] kfree+0x6a/0x250
mm/slab.c:3800
softirqs last enabled at (318): [<00000000c75b17c3>]
lock_sock_nested+0x91/0x110 net/core/sock.c:2765
softirqs last disabled at (316): [<00000000272f4822>] spin_lock_bh
include/linux/spinlock.h:320 [inline]
softirqs last disabled at (316): [<00000000272f4822>]
lock_sock_nested+0x44/0x110 net/core/sock.c:2762
CPU: 0 PID: 22259 Comm: syz-executor7 Not tainted 4.15.0-rc1+ #131
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:17 [inline]
dump_stack+0x194/0x257 lib/dump_stack.c:53
___might_sleep+0x2b2/0x470 kernel/sched/core.c:6060
__might_sleep+0x95/0x190 kernel/sched/core.c:6013
__do_page_fault+0x350/0xc90 arch/x86/mm/fault.c:1372
do_page_fault+0xee/0x720 arch/x86/mm/fault.c:1504
page_fault+0x22/0x30 arch/x86/entry/entry_64.S:1094
RIP: 0010:virt_to_cache mm/slab.c:400 [inline]
RIP: 0010:kfree+0xb2/0x250 mm/slab.c:3802
RSP: 0018:ffff8801cc82f780 EFLAGS: 00010046
RAX: 0000000000000000 RBX: ffff8801cc82f948 RCX: ffffffffffffffff
RDX: ffffea0007320bc0 RSI: 0000000000000000 RDI: ffff8801cc82f948
RBP: ffff8801cc82f7a0 R08: ffffed003a54e4dc R09: 0000000000000000
R10: 0000000000000001 R11: ffffed003a54e4db R12: 0000000000000286
R13: 0000000000000000 R14: ffff8801cc82f948 R15: ffff8801cc82f8b0
blkcipher_walk_done+0x72b/0xde0 crypto/blkcipher.c:139
encrypt+0x50a/0xaf0 crypto/salsa20_generic.c:208
skcipher_crypt_blkcipher crypto/skcipher.c:622 [inline]
skcipher_decrypt_blkcipher+0x213/0x310 crypto/skcipher.c:640
crypto_skcipher_decrypt include/crypto/skcipher.h:463 [inline]
_skcipher_recvmsg crypto/algif_skcipher.c:144 [inline]
skcipher_recvmsg+0xa54/0xf20 crypto/algif_skcipher.c:165
sock_recvmsg_nosec net/socket.c:805 [inline]
sock_recvmsg+0xc9/0x110 net/socket.c:812
___sys_recvmsg+0x29b/0x630 net/socket.c:2207
__sys_recvmsg+0xe2/0x210 net/socket.c:2252
SYSC_recvmsg net/socket.c:2264 [inline]
SyS_recvmsg+0x2d/0x50 net/socket.c:2259
entry_SYSCALL_64_fastpath+0x1f/0x96
RIP: 0033:0x4529d9
RSP: 002b:00007f6383e39c58 EFLAGS: 00000212 ORIG_RAX: 000000000000002f
RAX: ffffffffffffffda RBX: 0000000000758020 RCX: 00000000004529d9
RDX: 0000000000000121 RSI: 0000000020f39000 RDI: 0000000000000014
RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000212 R12: 00000000006ed0b8
R13: 00000000ffffffff R14: 00007f6383e3a6d4 R15: 0000000000000000
BUG: unable to handle kernel NULL pointer dereference at 000000002b7653e0
IP: virt_to_cache mm/slab.c:400 [inline]
IP: kfree+0xb2/0x250 mm/slab.c:3802
PGD 1caea7067 P4D 1caea7067 PUD 1d0029067 PMD 0
Oops: 0000 [#1] SMP KASAN
Dumping ftrace buffer:
(ftrace buffer empty)
Modules linked in:
CPU: 0 PID: 22259 Comm: syz-executor7 Tainted: G W
4.15.0-rc1+ #131
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
task: 000000000690a7ef task.stack: 00000000cb42ac8d
RIP: 0010:virt_to_cache mm/slab.c:400 [inline]
RIP: 0010:kfree+0xb2/0x250 mm/slab.c:3802
RSP: 0018:ffff8801cc82f780 EFLAGS: 00010046
RAX: 0000000000000000 RBX: ffff8801cc82f948 RCX: ffffffffffffffff
RDX: ffffea0007320bc0 RSI: 0000000000000000 RDI: ffff8801cc82f948
RBP: ffff8801cc82f7a0 R08: ffffed003a54e4dc R09: 0000000000000000
R10: 0000000000000001 R11: ffffed003a54e4db R12: 0000000000000286
R13: 0000000000000000 R14: ffff8801cc82f948 R15: ffff8801cc82f8b0
FS: 00007f6383e3a700(0000) GS:ffff8801db400000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000074 CR3: 00000001861fb000 CR4: 00000000001406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
blkcipher_walk_done+0x72b/0xde0 crypto/blkcipher.c:139
encrypt+0x50a/0xaf0 crypto/salsa20_generic.c:208
skcipher_crypt_blkcipher crypto/skcipher.c:622 [inline]
skcipher_decrypt_blkcipher+0x213/0x310 crypto/skcipher.c:640
crypto_skcipher_decrypt include/crypto/skcipher.h:463 [inline]
_skcipher_recvmsg crypto/algif_skcipher.c:144 [inline]
skcipher_recvmsg+0xa54/0xf20 crypto/algif_skcipher.c:165
sock_recvmsg_nosec net/socket.c:805 [inline]
sock_recvmsg+0xc9/0x110 net/socket.c:812
___sys_recvmsg+0x29b/0x630 net/socket.c:2207
__sys_recvmsg+0xe2/0x210 net/socket.c:2252
SYSC_recvmsg net/socket.c:2264 [inline]
SyS_recvmsg+0x2d/0x50 net/socket.c:2259
entry_SYSCALL_64_fastpath+0x1f/0x96
RIP: 0033:0x4529d9
RSP: 002b:00007f6383e39c58 EFLAGS: 00000212 ORIG_RAX: 000000000000002f
RAX: ffffffffffffffda RBX: 0000000000758020 RCX: 00000000004529d9
RDX: 0000000000000121 RSI: 0000000020f39000 RDI: 0000000000000014
RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000212 R12: 00000000006ed0b8
R13: 00000000ffffffff R14: 00007f6383e3a6d4 R15: 0000000000000000
Code: c2 48 b8 00 00 00 00 00 ea ff ff 48 89 df 48 c1 ea 0c 48 c1 e2 06 48
01 c2 48 8b 42 20 48 8d 48 ff a8 01 48 0f 45 d1 4c 8b 6a 30 <49> 63 75 74
e8 95 75 af ff 48 89 de 4c 89 ef 4c 8b 75 08 e8 06
RIP: virt_to_cache mm/slab.c:400 [inline] RSP: ffff8801cc82f780
RIP: kfree+0xb2/0x250 mm/slab.c:3802 RSP: ffff8801cc82f780
CR2: 0000000000000074
---[ end trace 30aa726f11cf7426 ]---


---
This bug is generated by a dumb bot. It may contain errors.
See https://goo.gl/tpsmEJ for details.
Direct all questions to syzk...@googlegroups.com.
Please credit me with: Reported-by: syzbot <syzk...@googlegroups.com>

syzbot will keep track of this bug report.
Once a fix for this bug is committed, please reply to this email with:
#syz fix: exact-commit-title
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.
config.txt
raw.log

Eric Biggers

unread,
Nov 30, 2017, 3:41:49 PM11/30/17
to syzbot, JBeu...@suse.com, h...@zytor.com, kirill....@linux.intel.com, ldu...@linux.vnet.ibm.com, linux-...@vger.kernel.org, lu...@kernel.org, mi...@redhat.com, ricardo.ne...@linux.intel.com, syzkall...@googlegroups.com, tg...@linutronix.de, x...@kernel.org
Yet another duplicate of the Salsa20 bug:

#syz dup: WARNING: suspicious RCU usage (3)

Looks like this one was incorrectly attributed to x86 rather than crypto?

kfree() is being called with preempt_count corrupted *and* with an uninitialized
pointer, so it can cause quite a few different problems...

Eric

Dmitry Vyukov

unread,
Dec 1, 2017, 3:20:04 AM12/1/17
to Eric Biggers, syzbot, Jan Beulich, H. Peter Anvin, Kirill A. Shutemov, ldu...@linux.vnet.ibm.com, LKML, Andy Lutomirski, Ingo Molnar, ricardo.ne...@linux.intel.com, syzkall...@googlegroups.com, Thomas Gleixner, the arch/x86 maintainers, andreyknvl
+Andrey, please check why syzbot has attributed this to x86.

> kfree() is being called with preempt_count corrupted *and* with an uninitialized
> pointer, so it can cause quite a few different problems...

Yeah, it's a bad one. Hopefully fixes will start to propagate soon.

Andrey Konovalov

unread,
Dec 8, 2017, 8:43:35 AM12/8/17
to Dmitry Vyukov, Eric Biggers, syzbot, Jan Beulich, H. Peter Anvin, Kirill A. Shutemov, ldu...@linux.vnet.ibm.com, LKML, Andy Lutomirski, Ingo Molnar, ricardo.ne...@linux.intel.com, syzkall...@googlegroups.com, Thomas Gleixner, the arch/x86 maintainers
Reply all
Reply to author
Forward
0 new messages