* crypto: ablk_decrypt causes BUG in scatterwalk
@ 2016-01-12 9:27 Dmitry Vyukov
2016-01-12 9:29 ` Dmitry Vyukov
2016-01-12 13:16 ` Herbert Xu
0 siblings, 2 replies; 7+ messages in thread
From: Dmitry Vyukov @ 2016-01-12 9:27 UTC (permalink / raw)
To: Herbert Xu, David S. Miller, linux-crypto, LKML
Cc: syzkaller, Kostya Serebryany, Alexander Potapenko, Sasha Levin,
Eric Dumazet
Hello,
The following program cause BUG in scatterwalk:
// autogenerated by syzkaller (http://github.com/google/syzkaller)
#include <unistd.h>
#include <sys/syscall.h>
#include <string.h>
#include <stdint.h>
#include <pthread.h>
long r[30];
void *thr(void *arg)
{
switch ((long)arg) {
case 0:
r[0] = syscall(SYS_mmap, 0x20000000ul, 0x32000ul,
0x3ul, 0x32ul, 0xfffffffffffffffful, 0x0ul);
break;
case 1:
r[1] = syscall(SYS_socket, 0x26ul, 0x5ul, 0x0ul, 0, 0, 0);
break;
case 2:
*(uint16_t*)0x2000c8ab = (uint16_t)0x26;
memcpy((void*)0x2000c8ad,
"\x73\x6b\x63\x69\x70\x68\x65\x72\x00\x00\x00\x00\x00\x00", 14);
*(uint32_t*)0x2000c8bb = (uint32_t)0x8;
*(uint32_t*)0x2000c8bf = (uint32_t)0xb;
memcpy((void*)0x2000c8c3,
"\x6c\x72\x77\x28\x73\x65\x72\x70\x65\x6e\x74\x29\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
64);
r[7] = syscall(SYS_bind, r[1], 0x2000c8abul, 0x58ul, 0, 0, 0);
break;
case 3:
memcpy((void*)0x2002cb94,
"\xdc\x4f\x77\x67\x54\xf2\x23\xd1\xbe\x5c\x6b\x02\xa6\x65\xc1\x0f\x74\xbd\xca\x88\x2e\x8c",
22);
r[9] = syscall(SYS_setsockopt, r[1], 0x117ul, 0x1ul,
0x2002cb94ul, 0x16ul, 0);
break;
case 4:
r[10] = syscall(SYS_accept4, r[1], 0x0ul,
0x2001f000ul, 0x80000ul, 0, 0);
break;
case 5:
memcpy((void*)0x2002f622,
"\x3d\xfd\xfe\x62\xbf\xa7\xa7\xdf\x4c\x40\x8f\x45\x46\x69\x27\x93\xa7\x35\x0b\xc6\xc9\x2b\xa2\x31\xf2\x9e\xb7\xb4\xaa\x9f\x96\xc1\x27\xf0\x9d\x3e\x81\xeb\xdc\x31\x02\x6c\x6c\xbc\xf5\xab\x5a\x25\x26\x76\x31\x4b\x4c\x50\xc4\xf6\x99\x1e\x69\xfc\x47\x49\xee\x12\xc4\xf3\x6c\x97\x58\xa6\xa6\xf8\x1c\x3d\x43\xcc\x6f\x6e\x9d\x89\x85\xb2\x53\x27\x43\xf7\x62\xcc\xa9\x6b\xda\x8f\xeb\x21\xa6\x49\xae\xb5\xf5\x43\x23\xbd\xe2\x29\x5c\x5d\x08\xa4\xd2\xb6\x7d\x72\x4f\x99\x38\x01\xd7\x31\x7b\xa3\xf1\xbb\x85\xf4\x9a\xb1\xa2\x9d\x03\xcb\x74\x7b\x5d\xf9\x83\x02\xd9\xc6\x74\x02\xd7\x01\xf9\xcb\x96\x05\x71\x94\x39\xd4\xc2\x27\xdd\x0f\x13\x72\x90\xdf\x84\xa9\x8f\x70\xb5\x7a",
164);
memcpy((void*)0x2002f000, "\x05\x00", 2);
r[13] = syscall(SYS_sendto, r[10], 0x2002f622ul,
0xa4ul, 0x8000ul, 0x2002f000ul, 0x2ul);
break;
case 6:
*(uint64_t*)0x20030e26 = (uint64_t)0x20002fb5;
*(uint32_t*)0x20030e2e = (uint32_t)0x80;
*(uint64_t*)0x20030e36 = (uint64_t)0x20030000;
*(uint64_t*)0x20030e3e = (uint64_t)0x4;
*(uint64_t*)0x20030e46 = (uint64_t)0x20030bd7;
*(uint64_t*)0x20030e4e = (uint64_t)0xcd;
*(uint32_t*)0x20030e56 = (uint32_t)0x4f3e;
*(uint64_t*)0x20030000 = (uint64_t)0x20030f76;
*(uint64_t*)0x20030008 = (uint64_t)0xfa;
*(uint64_t*)0x20030010 = (uint64_t)0x20030240;
*(uint64_t*)0x20030018 = (uint64_t)0x72;
*(uint64_t*)0x20030020 = (uint64_t)0x20030fb2;
*(uint64_t*)0x20030028 = (uint64_t)0x83;
*(uint64_t*)0x20030030 = (uint64_t)0x200304cf;
*(uint64_t*)0x20030038 = (uint64_t)0xde;
r[29] = syscall(SYS_recvmmsg, r[10], 0x20030e26ul,
0x1ul, 0x20ul, 0, 0);
break;
}
return 0;
}
int main()
{
long i;
pthread_t th[7];
memset(r, -1, sizeof(r));
for (i = 0; i < 7; i++) {
pthread_create(&th[i], 0, thr, (void*)i);
usleep(10000);
}
for (i = 0; i < 7; i++) {
pthread_create(&th[i], 0, thr, (void*)i);
if (i%2==0)
usleep(10000);
}
usleep(100000);
return 0;
}
------------[ cut here ]------------
kernel BUG at crypto/scatterwalk.c:37!
invalid opcode: 0000 [#1] SMP DEBUG_PAGEALLOC KASAN
Modules linked in:
CPU: 1 PID: 6684 Comm: syz-executor Not tainted 4.4.0+ #221
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
task: ffff880060d7de00 ti: ffff880065348000 task.ti: ffff880065348000
RIP: 0010:[<ffffffff82733529>] [<ffffffff82733529>]
scatterwalk_start.part.3+0x9/0x10
RSP: 0018:ffff88006534f400 EFLAGS: 00010297
RAX: ffff880060d7de00 RBX: ffff880037623150 RCX: ffff8800364b7310
RDX: 0000000000000000 RSI: ffff880037623150 RDI: ffff880037623164
RBP: ffff88006534f400 R08: ffff88006534f6b0 R09: ffff880037623148
R10: ffffed0006ec4638 R11: 1ffff10006ec4629 R12: ffff88006534f580
R13: 0000000000000000 R14: ffff88006534f5d8 R15: ffff88006534f560
FS: 00007fb85fc02700(0000) GS:ffff88003ed00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 0000000000451a70 CR3: 000000006257f000 CR4: 00000000000006e0
Stack:
ffff88006534f420 ffffffff827335f6 ffff88006534f820 ffff88006534f598
ffff88006534f478 ffffffff8273d640 ffffed000c4afb00 ffff880035581f60
0000000020031000 ffff8800364b7310 ffff88006534f560 ffff88006534f820
Call Trace:
[<ffffffff827335f6>] scatterwalk_start+0xc6/0xf0 crypto/scatterwalk.c:40
[<ffffffff8273d640>] blkcipher_walk_first+0x170/0x4d0 crypto/blkcipher.c:341
[<ffffffff8273dbb9>] blkcipher_walk_virt+0x219/0x2a0 crypto/blkcipher.c:307
[<ffffffff8278256b>] lrw_crypt+0x14b/0x990 crypto/lrw.c:234
[<ffffffff812a9ea8>] lrw_decrypt+0x128/0x1a0
arch/x86/crypto/serpent_avx2_glue.c:281
[<ffffffff828590c7>] ablk_decrypt+0x187/0x420 crypto/ablk_helper.c:108
[< inline >] skcipher_crypt_ablkcipher crypto/skcipher.c:157
[<ffffffff8273f2c2>] skcipher_decrypt_ablkcipher+0x312/0x420
crypto/skcipher.c:175
[< inline >] crypto_skcipher_decrypt include/crypto/skcipher.h:356
[< inline >] skcipher_recvmsg_sync crypto/algif_skcipher.c:680
[<ffffffff82849123>] skcipher_recvmsg+0x11d3/0x1c80 crypto/algif_skcipher.c:710
[< inline >] sock_recvmsg_nosec net/socket.c:713
[<ffffffff84d3aafd>] sock_recvmsg+0x9d/0xb0 net/socket.c:721
[<ffffffff84d3de29>] ___sys_recvmsg+0x259/0x540 net/socket.c:2099
[<ffffffff84d402d9>] __sys_recvmmsg+0x219/0x7b0 net/socket.c:2205
[< inline >] SYSC_recvmmsg net/socket.c:2279
[<ffffffff84d409df>] SyS_recvmmsg+0x16f/0x180 net/socket.c:2268
[<ffffffff85e74936>] entry_SYSCALL_64_fastpath+0x16/0x7a
arch/x86/entry/entry_64.S:185
Code: 41 5d 41 5e 41 5f 5d c3 e8 65 0f 00 ff e9 66 ff ff ff e8 5b 0f
00 ff eb ae 66 0f 1f 84 00 00 00 00 00 55 48 89 e5 e8 07 c8 e2 fe <0f>
0b 0f 1f 44 00 00 55 48 89 e5 41 54 53 49 89 fc 48 89 f3 e8
RIP [<ffffffff82733529>] scatterwalk_start.part.3+0x9/0x10
crypto/scatterwalk.c:37
RSP <ffff88006534f400>
------------[ cut here ]------------
------------[ cut here ]------------
kernel BUG at include/linux/scatterlist.h:123!
invalid opcode: 0000 [#49] SMP DEBUG_PAGEALLOC KASAN
Modules linked in:
CPU: 0 PID: 7643 Comm: syz-executor Tainted: G D 4.4.0+ #221
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
task: ffff88003e282f00 ti: ffff8800372a8000 task.ti: ffff8800372a8000
RIP: 0010:[<ffffffff8273ce05>] [<ffffffff8273ce05>]
blkcipher_walk_next+0xb55/0x1220
RSP: 0018:ffff8800372af3a8 EFLAGS: 00010297
RAX: ffff88003e282f00 RBX: ffff8800372af560 RCX: 0000000087654321
RDX: 0000000000000000 RSI: 1ffff10006e33639 RDI: ffff88003719b15c
RBP: ffff8800372af420 R08: ffff8800372af6b0 R09: 000000000000008a
R10: 0000000000000010 R11: 1ffff10006e33629 R12: 0000000000000000
R13: 00000000000000a0 R14: ffff8800372af590 R15: 0000000000000000
FS: 00007fb85fc02700(0000) GS:ffff88003ec00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 0000000020030e26 CR3: 0000000035615000 CR4: 00000000000006f0
Stack:
ffffffff8176d8cf 0000000000000000 ffff880035fcdcf8 ffff8800372af598
ffff8800372af5cc ffff8800372af580 ffff88003719b1c8 ffff88003719b148
8000000088fb30b0 ffff880000000f76 ffff8800372af820 ffff8800372af598
Call Trace:
[<ffffffff8273d699>] blkcipher_walk_first+0x1c9/0x4d0 crypto/blkcipher.c:345
[<ffffffff8273dbb9>] blkcipher_walk_virt+0x219/0x2a0 crypto/blkcipher.c:307
[<ffffffff8278256b>] lrw_crypt+0x14b/0x990 crypto/lrw.c:234
[<ffffffff812a9ea8>] lrw_decrypt+0x128/0x1a0
arch/x86/crypto/serpent_avx2_glue.c:281
[<ffffffff828590c7>] ablk_decrypt+0x187/0x420 crypto/ablk_helper.c:108
[< inline >] skcipher_crypt_ablkcipher crypto/skcipher.c:157
[<ffffffff8273f2c2>] skcipher_decrypt_ablkcipher+0x312/0x420
crypto/skcipher.c:175
[< inline >] crypto_skcipher_decrypt include/crypto/skcipher.h:356
[< inline >] skcipher_recvmsg_sync crypto/algif_skcipher.c:680
[<ffffffff82849123>] skcipher_recvmsg+0x11d3/0x1c80 crypto/algif_skcipher.c:710
[< inline >] sock_recvmsg_nosec net/socket.c:713
[<ffffffff84d3aafd>] sock_recvmsg+0x9d/0xb0 net/socket.c:721
[<ffffffff84d3de29>] ___sys_recvmsg+0x259/0x540 net/socket.c:2099
[<ffffffff84d402d9>] __sys_recvmmsg+0x219/0x7b0 net/socket.c:2205
[< inline >] SYSC_recvmmsg net/socket.c:2279
[<ffffffff84d409df>] SyS_recvmmsg+0x16f/0x180 net/socket.c:2268
[<ffffffff85e74936>] entry_SYSCALL_64_fastpath+0x16/0x7a
arch/x86/entry/entry_64.S:185
Code: e0 07 83 c0 03 38 d0 7c 09 84 d2 74 05 e8 84 76 ff fe 44 8b 6b
6c 45 31 e4 41 83 cd 02 44 89 6b 6c e9 0a fa ff ff e8 2b 2f e2 fe <0f>
0b e8 24 2f e2 fe 0f 0b 48 89 f7 e8 5a 76 ff fe e9 4d f5 ff
RIP [< inline >] blkcipher_next_fast include/linux/scatterlist.h:123
RIP [<ffffffff8273ce05>] blkcipher_walk_next+0xb55/0x1220
crypto/blkcipher.c:264
RSP <ffff8800372af3a8>
------------[ cut here ]------------
On commit afd2ff9b7e1b367172f18ba7f693dfb62bdcb2dc (Jan 10) + several
pending crypto fixes from Herbert:
https://gist.githubusercontent.com/dvyukov/fad55a75c516033c50a9/raw/e7297c104e0146807591dc0bc6c768b688f3b9af/gistfile1.txt
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: crypto: ablk_decrypt causes BUG in scatterwalk
2016-01-12 9:27 crypto: ablk_decrypt causes BUG in scatterwalk Dmitry Vyukov
@ 2016-01-12 9:29 ` Dmitry Vyukov
2016-01-12 13:16 ` Herbert Xu
1 sibling, 0 replies; 7+ messages in thread
From: Dmitry Vyukov @ 2016-01-12 9:29 UTC (permalink / raw)
To: Herbert Xu, David S. Miller, linux-crypto, LKML
Cc: syzkaller, Kostya Serebryany, Alexander Potapenko, Sasha Levin,
Eric Dumazet
On Tue, Jan 12, 2016 at 10:27 AM, Dmitry Vyukov <dvyukov@google.com> wrote:
> Hello,
>
> The following program cause BUG in scatterwalk:
>
>
> // autogenerated by syzkaller (http://github.com/google/syzkaller)
> #include <unistd.h>
> #include <sys/syscall.h>
> #include <string.h>
> #include <stdint.h>
> #include <pthread.h>
>
> long r[30];
>
> void *thr(void *arg)
> {
> switch ((long)arg) {
> case 0:
> r[0] = syscall(SYS_mmap, 0x20000000ul, 0x32000ul,
> 0x3ul, 0x32ul, 0xfffffffffffffffful, 0x0ul);
> break;
> case 1:
> r[1] = syscall(SYS_socket, 0x26ul, 0x5ul, 0x0ul, 0, 0, 0);
> break;
> case 2:
> *(uint16_t*)0x2000c8ab = (uint16_t)0x26;
> memcpy((void*)0x2000c8ad,
> "\x73\x6b\x63\x69\x70\x68\x65\x72\x00\x00\x00\x00\x00\x00", 14);
> *(uint32_t*)0x2000c8bb = (uint32_t)0x8;
> *(uint32_t*)0x2000c8bf = (uint32_t)0xb;
> memcpy((void*)0x2000c8c3,
> "\x6c\x72\x77\x28\x73\x65\x72\x70\x65\x6e\x74\x29\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
> 64);
> r[7] = syscall(SYS_bind, r[1], 0x2000c8abul, 0x58ul, 0, 0, 0);
> break;
> case 3:
> memcpy((void*)0x2002cb94,
> "\xdc\x4f\x77\x67\x54\xf2\x23\xd1\xbe\x5c\x6b\x02\xa6\x65\xc1\x0f\x74\xbd\xca\x88\x2e\x8c",
> 22);
> r[9] = syscall(SYS_setsockopt, r[1], 0x117ul, 0x1ul,
> 0x2002cb94ul, 0x16ul, 0);
> break;
> case 4:
> r[10] = syscall(SYS_accept4, r[1], 0x0ul,
> 0x2001f000ul, 0x80000ul, 0, 0);
> break;
> case 5:
> memcpy((void*)0x2002f622,
> "\x3d\xfd\xfe\x62\xbf\xa7\xa7\xdf\x4c\x40\x8f\x45\x46\x69\x27\x93\xa7\x35\x0b\xc6\xc9\x2b\xa2\x31\xf2\x9e\xb7\xb4\xaa\x9f\x96\xc1\x27\xf0\x9d\x3e\x81\xeb\xdc\x31\x02\x6c\x6c\xbc\xf5\xab\x5a\x25\x26\x76\x31\x4b\x4c\x50\xc4\xf6\x99\x1e\x69\xfc\x47\x49\xee\x12\xc4\xf3\x6c\x97\x58\xa6\xa6\xf8\x1c\x3d\x43\xcc\x6f\x6e\x9d\x89\x85\xb2\x53\x27\x43\xf7\x62\xcc\xa9\x6b\xda\x8f\xeb\x21\xa6\x49\xae\xb5\xf5\x43\x23\xbd\xe2\x29\x5c\x5d\x08\xa4\xd2\xb6\x7d\x72\x4f\x99\x38\x01\xd7\x31\x7b\xa3\xf1\xbb\x85\xf4\x9a\xb1\xa2\x9d\x03\xcb\x74\x7b\x5d\xf9\x83\x02\xd9\xc6\x74\x02\xd7\x01\xf9\xcb\x96\x05\x71\x94\x39\xd4\xc2\x27\xdd\x0f\x13\x72\x90\xdf\x84\xa9\x8f\x70\xb5\x7a",
> 164);
> memcpy((void*)0x2002f000, "\x05\x00", 2);
> r[13] = syscall(SYS_sendto, r[10], 0x2002f622ul,
> 0xa4ul, 0x8000ul, 0x2002f000ul, 0x2ul);
> break;
> case 6:
> *(uint64_t*)0x20030e26 = (uint64_t)0x20002fb5;
> *(uint32_t*)0x20030e2e = (uint32_t)0x80;
> *(uint64_t*)0x20030e36 = (uint64_t)0x20030000;
> *(uint64_t*)0x20030e3e = (uint64_t)0x4;
> *(uint64_t*)0x20030e46 = (uint64_t)0x20030bd7;
> *(uint64_t*)0x20030e4e = (uint64_t)0xcd;
> *(uint32_t*)0x20030e56 = (uint32_t)0x4f3e;
> *(uint64_t*)0x20030000 = (uint64_t)0x20030f76;
> *(uint64_t*)0x20030008 = (uint64_t)0xfa;
> *(uint64_t*)0x20030010 = (uint64_t)0x20030240;
> *(uint64_t*)0x20030018 = (uint64_t)0x72;
> *(uint64_t*)0x20030020 = (uint64_t)0x20030fb2;
> *(uint64_t*)0x20030028 = (uint64_t)0x83;
> *(uint64_t*)0x20030030 = (uint64_t)0x200304cf;
> *(uint64_t*)0x20030038 = (uint64_t)0xde;
> r[29] = syscall(SYS_recvmmsg, r[10], 0x20030e26ul,
> 0x1ul, 0x20ul, 0, 0);
> break;
> }
> return 0;
> }
>
> int main()
> {
> long i;
> pthread_t th[7];
>
> memset(r, -1, sizeof(r));
> for (i = 0; i < 7; i++) {
> pthread_create(&th[i], 0, thr, (void*)i);
> usleep(10000);
> }
> for (i = 0; i < 7; i++) {
> pthread_create(&th[i], 0, thr, (void*)i);
> if (i%2==0)
> usleep(10000);
> }
> usleep(100000);
> return 0;
> }
>
>
> ------------[ cut here ]------------
> kernel BUG at crypto/scatterwalk.c:37!
> invalid opcode: 0000 [#1] SMP DEBUG_PAGEALLOC KASAN
> Modules linked in:
> CPU: 1 PID: 6684 Comm: syz-executor Not tainted 4.4.0+ #221
> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
> task: ffff880060d7de00 ti: ffff880065348000 task.ti: ffff880065348000
> RIP: 0010:[<ffffffff82733529>] [<ffffffff82733529>]
> scatterwalk_start.part.3+0x9/0x10
> RSP: 0018:ffff88006534f400 EFLAGS: 00010297
> RAX: ffff880060d7de00 RBX: ffff880037623150 RCX: ffff8800364b7310
> RDX: 0000000000000000 RSI: ffff880037623150 RDI: ffff880037623164
> RBP: ffff88006534f400 R08: ffff88006534f6b0 R09: ffff880037623148
> R10: ffffed0006ec4638 R11: 1ffff10006ec4629 R12: ffff88006534f580
> R13: 0000000000000000 R14: ffff88006534f5d8 R15: ffff88006534f560
> FS: 00007fb85fc02700(0000) GS:ffff88003ed00000(0000) knlGS:0000000000000000
> CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
> CR2: 0000000000451a70 CR3: 000000006257f000 CR4: 00000000000006e0
> Stack:
> ffff88006534f420 ffffffff827335f6 ffff88006534f820 ffff88006534f598
> ffff88006534f478 ffffffff8273d640 ffffed000c4afb00 ffff880035581f60
> 0000000020031000 ffff8800364b7310 ffff88006534f560 ffff88006534f820
> Call Trace:
> [<ffffffff827335f6>] scatterwalk_start+0xc6/0xf0 crypto/scatterwalk.c:40
> [<ffffffff8273d640>] blkcipher_walk_first+0x170/0x4d0 crypto/blkcipher.c:341
> [<ffffffff8273dbb9>] blkcipher_walk_virt+0x219/0x2a0 crypto/blkcipher.c:307
> [<ffffffff8278256b>] lrw_crypt+0x14b/0x990 crypto/lrw.c:234
> [<ffffffff812a9ea8>] lrw_decrypt+0x128/0x1a0
> arch/x86/crypto/serpent_avx2_glue.c:281
> [<ffffffff828590c7>] ablk_decrypt+0x187/0x420 crypto/ablk_helper.c:108
> [< inline >] skcipher_crypt_ablkcipher crypto/skcipher.c:157
> [<ffffffff8273f2c2>] skcipher_decrypt_ablkcipher+0x312/0x420
> crypto/skcipher.c:175
> [< inline >] crypto_skcipher_decrypt include/crypto/skcipher.h:356
> [< inline >] skcipher_recvmsg_sync crypto/algif_skcipher.c:680
> [<ffffffff82849123>] skcipher_recvmsg+0x11d3/0x1c80 crypto/algif_skcipher.c:710
> [< inline >] sock_recvmsg_nosec net/socket.c:713
> [<ffffffff84d3aafd>] sock_recvmsg+0x9d/0xb0 net/socket.c:721
> [<ffffffff84d3de29>] ___sys_recvmsg+0x259/0x540 net/socket.c:2099
> [<ffffffff84d402d9>] __sys_recvmmsg+0x219/0x7b0 net/socket.c:2205
> [< inline >] SYSC_recvmmsg net/socket.c:2279
> [<ffffffff84d409df>] SyS_recvmmsg+0x16f/0x180 net/socket.c:2268
> [<ffffffff85e74936>] entry_SYSCALL_64_fastpath+0x16/0x7a
> arch/x86/entry/entry_64.S:185
> Code: 41 5d 41 5e 41 5f 5d c3 e8 65 0f 00 ff e9 66 ff ff ff e8 5b 0f
> 00 ff eb ae 66 0f 1f 84 00 00 00 00 00 55 48 89 e5 e8 07 c8 e2 fe <0f>
> 0b 0f 1f 44 00 00 55 48 89 e5 41 54 53 49 89 fc 48 89 f3 e8
> RIP [<ffffffff82733529>] scatterwalk_start.part.3+0x9/0x10
> crypto/scatterwalk.c:37
> RSP <ffff88006534f400>
> ------------[ cut here ]------------
>
> ------------[ cut here ]------------
> kernel BUG at include/linux/scatterlist.h:123!
> invalid opcode: 0000 [#49] SMP DEBUG_PAGEALLOC KASAN
> Modules linked in:
> CPU: 0 PID: 7643 Comm: syz-executor Tainted: G D 4.4.0+ #221
> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
> task: ffff88003e282f00 ti: ffff8800372a8000 task.ti: ffff8800372a8000
> RIP: 0010:[<ffffffff8273ce05>] [<ffffffff8273ce05>]
> blkcipher_walk_next+0xb55/0x1220
> RSP: 0018:ffff8800372af3a8 EFLAGS: 00010297
> RAX: ffff88003e282f00 RBX: ffff8800372af560 RCX: 0000000087654321
> RDX: 0000000000000000 RSI: 1ffff10006e33639 RDI: ffff88003719b15c
> RBP: ffff8800372af420 R08: ffff8800372af6b0 R09: 000000000000008a
> R10: 0000000000000010 R11: 1ffff10006e33629 R12: 0000000000000000
> R13: 00000000000000a0 R14: ffff8800372af590 R15: 0000000000000000
> FS: 00007fb85fc02700(0000) GS:ffff88003ec00000(0000) knlGS:0000000000000000
> CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
> CR2: 0000000020030e26 CR3: 0000000035615000 CR4: 00000000000006f0
> Stack:
> ffffffff8176d8cf 0000000000000000 ffff880035fcdcf8 ffff8800372af598
> ffff8800372af5cc ffff8800372af580 ffff88003719b1c8 ffff88003719b148
> 8000000088fb30b0 ffff880000000f76 ffff8800372af820 ffff8800372af598
> Call Trace:
> [<ffffffff8273d699>] blkcipher_walk_first+0x1c9/0x4d0 crypto/blkcipher.c:345
> [<ffffffff8273dbb9>] blkcipher_walk_virt+0x219/0x2a0 crypto/blkcipher.c:307
> [<ffffffff8278256b>] lrw_crypt+0x14b/0x990 crypto/lrw.c:234
> [<ffffffff812a9ea8>] lrw_decrypt+0x128/0x1a0
> arch/x86/crypto/serpent_avx2_glue.c:281
> [<ffffffff828590c7>] ablk_decrypt+0x187/0x420 crypto/ablk_helper.c:108
> [< inline >] skcipher_crypt_ablkcipher crypto/skcipher.c:157
> [<ffffffff8273f2c2>] skcipher_decrypt_ablkcipher+0x312/0x420
> crypto/skcipher.c:175
> [< inline >] crypto_skcipher_decrypt include/crypto/skcipher.h:356
> [< inline >] skcipher_recvmsg_sync crypto/algif_skcipher.c:680
> [<ffffffff82849123>] skcipher_recvmsg+0x11d3/0x1c80 crypto/algif_skcipher.c:710
> [< inline >] sock_recvmsg_nosec net/socket.c:713
> [<ffffffff84d3aafd>] sock_recvmsg+0x9d/0xb0 net/socket.c:721
> [<ffffffff84d3de29>] ___sys_recvmsg+0x259/0x540 net/socket.c:2099
> [<ffffffff84d402d9>] __sys_recvmmsg+0x219/0x7b0 net/socket.c:2205
> [< inline >] SYSC_recvmmsg net/socket.c:2279
> [<ffffffff84d409df>] SyS_recvmmsg+0x16f/0x180 net/socket.c:2268
> [<ffffffff85e74936>] entry_SYSCALL_64_fastpath+0x16/0x7a
> arch/x86/entry/entry_64.S:185
> Code: e0 07 83 c0 03 38 d0 7c 09 84 d2 74 05 e8 84 76 ff fe 44 8b 6b
> 6c 45 31 e4 41 83 cd 02 44 89 6b 6c e9 0a fa ff ff e8 2b 2f e2 fe <0f>
> 0b e8 24 2f e2 fe 0f 0b 48 89 f7 e8 5a 76 ff fe e9 4d f5 ff
> RIP [< inline >] blkcipher_next_fast include/linux/scatterlist.h:123
> RIP [<ffffffff8273ce05>] blkcipher_walk_next+0xb55/0x1220
> crypto/blkcipher.c:264
> RSP <ffff8800372af3a8>
> ------------[ cut here ]------------
>
>
> On commit afd2ff9b7e1b367172f18ba7f693dfb62bdcb2dc (Jan 10) + several
> pending crypto fixes from Herbert:
> https://gist.githubusercontent.com/dvyukov/fad55a75c516033c50a9/raw/e7297c104e0146807591dc0bc6c768b688f3b9af/gistfile1.txt
I've also seen a slightly different call stack:
------------[ cut here ]------------
kernel BUG at include/linux/scatterlist.h:123!
invalid opcode: 0000 [#1] SMP DEBUG_PAGEALLOC KASAN
Modules linked in:
CPU: 0 PID: 8285 Comm: syz-executor Not tainted 4.4.0+ #221
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
task: ffff880063674680 ti: ffff880053918000 task.ti: ffff880053918000
RIP: 0010:[<ffffffff8273ce05>] [<ffffffff8273ce05>]
blkcipher_walk_next+0xb55/0x1220
RSP: 0018:ffff88005391f7f8 EFLAGS: 00010287
RAX: ffffffff8273ce05 RBX: ffff88005391fa00 RCX: ffffc900025dc000
RDX: 0000000000000364 RSI: 0000000000000365 RDI: ffff88001454a90c
RBP: ffff88005391f870 R08: ffffed00028a9528 R09: 0000000000000ff9
R10: 0000000000000008 R11: 1ffff100028a951f R12: 0000000000000000
R13: 0000000000000050 R14: ffff88005391fa30 R15: 00000000fffffff0
FS: 00007f4719c8a700(0000) GS:ffff88003ec00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 0000000020024000 CR3: 0000000000c6d000 CR4: 00000000000006f0
Stack:
ffff880000000001 ffff880063674680 ffffffff8825d308 ffff88005391fa38
ffff88005391fa6c ffff88005391fa20 ffff88001454ac98 ffff88001454a8f8
ffffffff1454ac98 0000000000000007 ffff88005391fb08 ffff88005391fa38
Call Trace:
[<ffffffff8273d699>] blkcipher_walk_first+0x1c9/0x4d0 crypto/blkcipher.c:345
[<ffffffff8273e0fc>] blkcipher_walk_virt_block+0x21c/0x2a0
crypto/blkcipher.c:357
[<ffffffff81298386>] ctr_crypt+0xb6/0x5b0
arch/x86/crypto/serpent_avx2_glue.c:156
[< inline >] skcipher_crypt_blkcipher crypto/skcipher.c:66
[<ffffffff8273e934>] skcipher_decrypt_blkcipher+0x1b4/0x260
crypto/skcipher.c:84
[< inline >] crypto_skcipher_decrypt include/crypto/skcipher.h:356
[< inline >] skcipher_recvmsg_sync crypto/algif_skcipher.c:680
[<ffffffff82849123>] skcipher_recvmsg+0x11d3/0x1c80 crypto/algif_skcipher.c:710
[< inline >] sock_recvmsg_nosec net/socket.c:713
[<ffffffff84d3aafd>] sock_recvmsg+0x9d/0xb0 net/socket.c:721
[<ffffffff84d3b171>] SYSC_recvfrom+0x1e1/0x330 net/socket.c:1702
[<ffffffff84d3f360>] SyS_recvfrom+0x40/0x50 net/socket.c:1675
[<ffffffff85e74936>] entry_SYSCALL_64_fastpath+0x16/0x7a
arch/x86/entry/entry_64.S:185
Code: e0 07 83 c0 03 38 d0 7c 09 84 d2 74 05 e8 84 76 ff fe 44 8b 6b
6c 45 31 e4 41 83 cd 02 44 89 6b 6c e9 0a fa ff ff e8 2b 2f e2 fe <0f>
0b e8 24 2f e2 fe 0f 0b 48 89 f7 e8 5a 76 ff fe e9 4d f5 ff
RIP [< inline >] blkcipher_next_fast include/linux/scatterlist.h:123
RIP [<ffffffff8273ce05>] blkcipher_walk_next+0xb55/0x1220
crypto/blkcipher.c:264
RSP <ffff88005391f7f8>
---[ end trace 14e82e4e86a6d5f0 ]---
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: crypto: ablk_decrypt causes BUG in scatterwalk
2016-01-12 9:27 crypto: ablk_decrypt causes BUG in scatterwalk Dmitry Vyukov
2016-01-12 9:29 ` Dmitry Vyukov
@ 2016-01-12 13:16 ` Herbert Xu
2016-01-12 13:23 ` Dmitry Vyukov
1 sibling, 1 reply; 7+ messages in thread
From: Herbert Xu @ 2016-01-12 13:16 UTC (permalink / raw)
To: Dmitry Vyukov
Cc: David S. Miller, linux-crypto, LKML, syzkaller, Kostya Serebryany,
Alexander Potapenko, Sasha Levin, Eric Dumazet
On Tue, Jan 12, 2016 at 10:27:44AM +0100, Dmitry Vyukov wrote:
> Hello,
>
> The following program cause BUG in scatterwalk:
Weird, I can't reproduce the crash. Can you perhaps convert this to
a non-racy reproduction, possibly by using strace to find the order
of execution that leads to the crash?
Thanks,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: crypto: ablk_decrypt causes BUG in scatterwalk
2016-01-12 13:16 ` Herbert Xu
@ 2016-01-12 13:23 ` Dmitry Vyukov
2016-01-12 16:27 ` Dmitry Vyukov
0 siblings, 1 reply; 7+ messages in thread
From: Dmitry Vyukov @ 2016-01-12 13:23 UTC (permalink / raw)
To: syzkaller
Cc: David S. Miller, linux-crypto, LKML, Kostya Serebryany,
Alexander Potapenko, Sasha Levin, Eric Dumazet
On Tue, Jan 12, 2016 at 2:16 PM, Herbert Xu <herbert@gondor.apana.org.au> wrote:
> On Tue, Jan 12, 2016 at 10:27:44AM +0100, Dmitry Vyukov wrote:
>> Hello,
>>
>> The following program cause BUG in scatterwalk:
>
> Weird, I can't reproduce the crash. Can you perhaps convert this to
> a non-racy reproduction, possibly by using strace to find the order
> of execution that leads to the crash?
Concurrent execution seems to be important to reproduce the crash. I
wasn't able to reproduce it in single-threaded mode.
Try to run it in a tight parallel loop for some time.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: crypto: ablk_decrypt causes BUG in scatterwalk
2016-01-12 13:23 ` Dmitry Vyukov
@ 2016-01-12 16:27 ` Dmitry Vyukov
2016-01-12 17:09 ` Dmitry Vyukov
0 siblings, 1 reply; 7+ messages in thread
From: Dmitry Vyukov @ 2016-01-12 16:27 UTC (permalink / raw)
To: syzkaller
Cc: David S. Miller, linux-crypto, LKML, Kostya Serebryany,
Alexander Potapenko, Sasha Levin, Eric Dumazet
On Tue, Jan 12, 2016 at 2:23 PM, Dmitry Vyukov <dvyukov@google.com> wrote:
> On Tue, Jan 12, 2016 at 2:16 PM, Herbert Xu <herbert@gondor.apana.org.au> wrote:
>> On Tue, Jan 12, 2016 at 10:27:44AM +0100, Dmitry Vyukov wrote:
>>> Hello,
>>>
>>> The following program cause BUG in scatterwalk:
>>
>> Weird, I can't reproduce the crash. Can you perhaps convert this to
>> a non-racy reproduction, possibly by using strace to find the order
>> of execution that leads to the crash?
>
>
> Concurrent execution seems to be important to reproduce the crash. I
> wasn't able to reproduce it in single-threaded mode.
> Try to run it in a tight parallel loop for some time.
I've extracted another reproducer:
https://gist.githubusercontent.com/dvyukov/94aed45494edf1dff0a8/raw/a31f439fdcdd8a8905235a9bce6e5863ca8ccf68/gistfile1.txt
I don't know whether there is a simpler way to run a reproducer in a
tight parallel loop, but I use:
$ go get golang.org/x/tools/cmd/stress
$ GOPATH/bin/stress -p 16 ./a.out
It triggers the BUG within seconds for me.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: crypto: ablk_decrypt causes BUG in scatterwalk
2016-01-12 16:27 ` Dmitry Vyukov
@ 2016-01-12 17:09 ` Dmitry Vyukov
2016-01-12 18:10 ` Dmitry Vyukov
0 siblings, 1 reply; 7+ messages in thread
From: Dmitry Vyukov @ 2016-01-12 17:09 UTC (permalink / raw)
To: syzkaller
Cc: David S. Miller, linux-crypto, LKML, Kostya Serebryany,
Alexander Potapenko, Sasha Levin, Eric Dumazet
I can _not_ reproduce it on clean upstream tree, nor on
git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6.git.
I probably messed up something with the unmerged fixes during my rebase.
Sorry.
On Tue, Jan 12, 2016 at 5:27 PM, Dmitry Vyukov <dvyukov@google.com> wrote:
> On Tue, Jan 12, 2016 at 2:23 PM, Dmitry Vyukov <dvyukov@google.com> wrote:
>> On Tue, Jan 12, 2016 at 2:16 PM, Herbert Xu <herbert@gondor.apana.org.au> wrote:
>>> On Tue, Jan 12, 2016 at 10:27:44AM +0100, Dmitry Vyukov wrote:
>>>> Hello,
>>>>
>>>> The following program cause BUG in scatterwalk:
>>>
>>> Weird, I can't reproduce the crash. Can you perhaps convert this to
>>> a non-racy reproduction, possibly by using strace to find the order
>>> of execution that leads to the crash?
>>
>>
>> Concurrent execution seems to be important to reproduce the crash. I
>> wasn't able to reproduce it in single-threaded mode.
>> Try to run it in a tight parallel loop for some time.
>
>
> I've extracted another reproducer:
> https://gist.githubusercontent.com/dvyukov/94aed45494edf1dff0a8/raw/a31f439fdcdd8a8905235a9bce6e5863ca8ccf68/gistfile1.txt
>
> I don't know whether there is a simpler way to run a reproducer in a
> tight parallel loop, but I use:
> $ go get golang.org/x/tools/cmd/stress
> $ GOPATH/bin/stress -p 16 ./a.out
>
> It triggers the BUG within seconds for me.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: crypto: ablk_decrypt causes BUG in scatterwalk
2016-01-12 17:09 ` Dmitry Vyukov
@ 2016-01-12 18:10 ` Dmitry Vyukov
0 siblings, 0 replies; 7+ messages in thread
From: Dmitry Vyukov @ 2016-01-12 18:10 UTC (permalink / raw)
To: syzkaller
Cc: David S. Miller, linux-crypto, LKML, Kostya Serebryany,
Alexander Potapenko, Sasha Levin, Eric Dumazet
On Tue, Jan 12, 2016 at 6:09 PM, Dmitry Vyukov <dvyukov@google.com> wrote:
> I can _not_ reproduce it on clean upstream tree, nor on
> git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6.git.
> I probably messed up something with the unmerged fixes during my rebase.
> Sorry.
Wait, no. I can reproduce it on
git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6.git
master (cd7e98414462b9db70067ac29896c58210b13b69). The difference was
in .config. Below is my config grep CRYPTO.
Please try to reproduce it with this config.
CONFIG_BLK_DEV_CRYPTOLOOP=y
CONFIG_RTLLIB_CRYPTO_CCMP=m
CONFIG_RTLLIB_CRYPTO_TKIP=m
CONFIG_RTLLIB_CRYPTO_WEP=m
# CONFIG_CRYPTO_SKEIN is not set
CONFIG_CRYPTO=y
CONFIG_CRYPTO_ALGAPI=y
CONFIG_CRYPTO_ALGAPI2=y
CONFIG_CRYPTO_AEAD=y
CONFIG_CRYPTO_AEAD2=y
CONFIG_CRYPTO_BLKCIPHER=y
CONFIG_CRYPTO_BLKCIPHER2=y
CONFIG_CRYPTO_HASH=y
CONFIG_CRYPTO_HASH2=y
CONFIG_CRYPTO_RNG=y
CONFIG_CRYPTO_RNG2=y
CONFIG_CRYPTO_RNG_DEFAULT=y
CONFIG_CRYPTO_PCOMP=y
CONFIG_CRYPTO_PCOMP2=y
CONFIG_CRYPTO_AKCIPHER2=y
CONFIG_CRYPTO_AKCIPHER=y
CONFIG_CRYPTO_RSA=y
CONFIG_CRYPTO_MANAGER=y
CONFIG_CRYPTO_MANAGER2=y
CONFIG_CRYPTO_USER=y
# CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set
CONFIG_CRYPTO_GF128MUL=y
CONFIG_CRYPTO_NULL=y
CONFIG_CRYPTO_NULL2=y
CONFIG_CRYPTO_PCRYPT=y
CONFIG_CRYPTO_WORKQUEUE=y
CONFIG_CRYPTO_CRYPTD=y
CONFIG_CRYPTO_MCRYPTD=y
CONFIG_CRYPTO_AUTHENC=y
# CONFIG_CRYPTO_TEST is not set
CONFIG_CRYPTO_ABLK_HELPER=y
CONFIG_CRYPTO_GLUE_HELPER_X86=y
CONFIG_CRYPTO_CCM=y
CONFIG_CRYPTO_GCM=y
CONFIG_CRYPTO_CHACHA20POLY1305=y
CONFIG_CRYPTO_SEQIV=y
CONFIG_CRYPTO_ECHAINIV=y
CONFIG_CRYPTO_CBC=y
CONFIG_CRYPTO_CTR=y
CONFIG_CRYPTO_CTS=y
CONFIG_CRYPTO_ECB=y
CONFIG_CRYPTO_LRW=y
CONFIG_CRYPTO_PCBC=y
CONFIG_CRYPTO_XTS=y
CONFIG_CRYPTO_KEYWRAP=y
CONFIG_CRYPTO_CMAC=y
CONFIG_CRYPTO_HMAC=y
CONFIG_CRYPTO_XCBC=y
CONFIG_CRYPTO_VMAC=y
CONFIG_CRYPTO_CRC32C=y
CONFIG_CRYPTO_CRC32C_INTEL=y
CONFIG_CRYPTO_CRC32=y
CONFIG_CRYPTO_CRC32_PCLMUL=y
CONFIG_CRYPTO_CRCT10DIF=y
CONFIG_CRYPTO_CRCT10DIF_PCLMUL=y
CONFIG_CRYPTO_GHASH=y
CONFIG_CRYPTO_POLY1305=y
CONFIG_CRYPTO_POLY1305_X86_64=y
CONFIG_CRYPTO_MD4=y
CONFIG_CRYPTO_MD5=y
CONFIG_CRYPTO_MICHAEL_MIC=y
CONFIG_CRYPTO_RMD128=y
CONFIG_CRYPTO_RMD160=y
CONFIG_CRYPTO_RMD256=y
CONFIG_CRYPTO_RMD320=y
CONFIG_CRYPTO_SHA1=y
CONFIG_CRYPTO_SHA1_SSSE3=y
CONFIG_CRYPTO_SHA256_SSSE3=y
CONFIG_CRYPTO_SHA512_SSSE3=y
CONFIG_CRYPTO_SHA1_MB=y
CONFIG_CRYPTO_SHA256=y
CONFIG_CRYPTO_SHA512=y
CONFIG_CRYPTO_TGR192=y
CONFIG_CRYPTO_WP512=y
CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL=y
CONFIG_CRYPTO_AES=y
CONFIG_CRYPTO_AES_X86_64=y
CONFIG_CRYPTO_AES_NI_INTEL=y
CONFIG_CRYPTO_ANUBIS=y
CONFIG_CRYPTO_ARC4=y
CONFIG_CRYPTO_BLOWFISH=y
CONFIG_CRYPTO_BLOWFISH_COMMON=y
CONFIG_CRYPTO_BLOWFISH_X86_64=y
CONFIG_CRYPTO_CAMELLIA=y
CONFIG_CRYPTO_CAMELLIA_X86_64=y
CONFIG_CRYPTO_CAMELLIA_AESNI_AVX_X86_64=y
CONFIG_CRYPTO_CAMELLIA_AESNI_AVX2_X86_64=y
CONFIG_CRYPTO_CAST_COMMON=y
CONFIG_CRYPTO_CAST5=y
CONFIG_CRYPTO_CAST5_AVX_X86_64=y
CONFIG_CRYPTO_CAST6=y
CONFIG_CRYPTO_CAST6_AVX_X86_64=y
CONFIG_CRYPTO_DES=y
CONFIG_CRYPTO_DES3_EDE_X86_64=y
CONFIG_CRYPTO_FCRYPT=y
CONFIG_CRYPTO_KHAZAD=y
CONFIG_CRYPTO_SALSA20=y
CONFIG_CRYPTO_SALSA20_X86_64=y
CONFIG_CRYPTO_CHACHA20=y
CONFIG_CRYPTO_CHACHA20_X86_64=y
CONFIG_CRYPTO_SEED=y
CONFIG_CRYPTO_SERPENT=y
CONFIG_CRYPTO_SERPENT_SSE2_X86_64=y
CONFIG_CRYPTO_SERPENT_AVX_X86_64=y
CONFIG_CRYPTO_SERPENT_AVX2_X86_64=y
CONFIG_CRYPTO_TEA=y
CONFIG_CRYPTO_TWOFISH=y
CONFIG_CRYPTO_TWOFISH_COMMON=y
CONFIG_CRYPTO_TWOFISH_X86_64=y
CONFIG_CRYPTO_TWOFISH_X86_64_3WAY=y
CONFIG_CRYPTO_TWOFISH_AVX_X86_64=y
CONFIG_CRYPTO_DEFLATE=y
CONFIG_CRYPTO_ZLIB=y
CONFIG_CRYPTO_LZO=y
CONFIG_CRYPTO_842=y
CONFIG_CRYPTO_LZ4=y
CONFIG_CRYPTO_LZ4HC=y
CONFIG_CRYPTO_ANSI_CPRNG=y
CONFIG_CRYPTO_DRBG_MENU=y
CONFIG_CRYPTO_DRBG_HMAC=y
# CONFIG_CRYPTO_DRBG_HASH is not set
# CONFIG_CRYPTO_DRBG_CTR is not set
CONFIG_CRYPTO_DRBG=y
CONFIG_CRYPTO_JITTERENTROPY=y
CONFIG_CRYPTO_USER_API=y
CONFIG_CRYPTO_USER_API_HASH=y
CONFIG_CRYPTO_USER_API_SKCIPHER=y
CONFIG_CRYPTO_USER_API_RNG=y
CONFIG_CRYPTO_USER_API_AEAD=y
CONFIG_CRYPTO_HASH_INFO=y
CONFIG_CRYPTO_HW=y
# CONFIG_CRYPTO_DEV_PADLOCK is not set
# CONFIG_CRYPTO_DEV_CCP is not set
# CONFIG_CRYPTO_DEV_QAT_DH895xCC is not set
# CONFIG_CRYPTO_DEV_QAT_DH895xCCVF is not set
> On Tue, Jan 12, 2016 at 5:27 PM, Dmitry Vyukov <dvyukov@google.com> wrote:
>> On Tue, Jan 12, 2016 at 2:23 PM, Dmitry Vyukov <dvyukov@google.com> wrote:
>>> On Tue, Jan 12, 2016 at 2:16 PM, Herbert Xu <herbert@gondor.apana.org.au> wrote:
>>>> On Tue, Jan 12, 2016 at 10:27:44AM +0100, Dmitry Vyukov wrote:
>>>>> Hello,
>>>>>
>>>>> The following program cause BUG in scatterwalk:
>>>>
>>>> Weird, I can't reproduce the crash. Can you perhaps convert this to
>>>> a non-racy reproduction, possibly by using strace to find the order
>>>> of execution that leads to the crash?
>>>
>>>
>>> Concurrent execution seems to be important to reproduce the crash. I
>>> wasn't able to reproduce it in single-threaded mode.
>>> Try to run it in a tight parallel loop for some time.
>>
>>
>> I've extracted another reproducer:
>> https://gist.githubusercontent.com/dvyukov/94aed45494edf1dff0a8/raw/a31f439fdcdd8a8905235a9bce6e5863ca8ccf68/gistfile1.txt
>>
>> I don't know whether there is a simpler way to run a reproducer in a
>> tight parallel loop, but I use:
>> $ go get golang.org/x/tools/cmd/stress
>> $ GOPATH/bin/stress -p 16 ./a.out
>>
>> It triggers the BUG within seconds for me.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2016-01-12 18:10 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-12 9:27 crypto: ablk_decrypt causes BUG in scatterwalk Dmitry Vyukov
2016-01-12 9:29 ` Dmitry Vyukov
2016-01-12 13:16 ` Herbert Xu
2016-01-12 13:23 ` Dmitry Vyukov
2016-01-12 16:27 ` Dmitry Vyukov
2016-01-12 17:09 ` Dmitry Vyukov
2016-01-12 18:10 ` Dmitry Vyukov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox