syzbot


KMSAN: uninit-value in af_alg_free_areq_sgls

Status: fixed on 2018/08/07 13:43
Subsystems: crypto
[Documentation on labels]
Reported-by: syzbot+9c251bdd09f83b92ba95@syzkaller.appspotmail.com
Fix commit: 2546da99212f crypto: af_alg - Initialize sg_num_bytes in error code path
First crash: 2436d, last: 2327d
Discussions (7)
Title Replies (including bot) Last reply
[PATCH 4.17 000/101] 4.17.9-stable review 100 (101) 2018/07/22 11:42
[PATCH 4.14 00/92] 4.14.57-stable review 91 (92) 2018/07/21 13:41
[PATCH v4] AF_ALG: Initialize sg_num_bytes in error code path 2 (3) 2018/07/13 10:34
[PATCH v3] AF_ALG: Initialize sg_num_bytes in error code path 6 (8) 2018/07/06 21:57
[PATCH v2] AF_ALG: Initialize sg_num_bytes in error code path 5 (6) 2018/07/06 07:44
[PATCH] AF_ALG: register completely initialized request in list 6 (6) 2018/07/05 08:43
KMSAN: uninit-value in af_alg_free_areq_sgls 0 (1) 2018/04/08 07:07

Sample crash report:
==================================================================
BUG: KMSAN: uninit-value in atomic_sub arch/x86/include/asm/atomic.h:65 [inline]
BUG: KMSAN: uninit-value in af_alg_free_areq_sgls+0x5ff/0xb20 crypto/af_alg.c:669
CPU: 1 PID: 3568 Comm: syzkaller909997 Not tainted 4.16.0+ #82
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+0x185/0x1d0 lib/dump_stack.c:53
 kmsan_report+0x142/0x240 mm/kmsan/kmsan.c:1067
 __msan_warning_32+0x6c/0xb0 mm/kmsan/kmsan_instr.c:676
 atomic_sub arch/x86/include/asm/atomic.h:65 [inline]
 af_alg_free_areq_sgls+0x5ff/0xb20 crypto/af_alg.c:669
 af_alg_free_resources+0x66/0xf0 crypto/af_alg.c:1033
 _aead_recvmsg crypto/algif_aead.c:321 [inline]
 aead_recvmsg+0x9a4/0x2960 crypto/algif_aead.c:334
 aead_recvmsg_nokey+0x129/0x160 crypto/algif_aead.c:452
 sock_recvmsg_nosec net/socket.c:803 [inline]
 sock_recvmsg+0x1d0/0x230 net/socket.c:810
 ___sys_recvmsg+0x3fb/0x810 net/socket.c:2205
 __sys_recvmsg net/socket.c:2250 [inline]
 SYSC_recvmsg+0x298/0x3c0 net/socket.c:2262
 SyS_recvmsg+0x54/0x80 net/socket.c:2257
 do_syscall_64+0x309/0x430 arch/x86/entry/common.c:287
 entry_SYSCALL_64_after_hwframe+0x3d/0xa2
RIP: 0033:0x43ff29
RSP: 002b:00007ffd9919c808 EFLAGS: 00000207 ORIG_RAX: 000000000000002f
RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 000000000043ff29
RDX: 0000000000000000 RSI: 0000000020000040 RDI: 0000000000000004
RBP: 00000000006ca018 R08: 00000000004002c8 R09: 00000000004002c8
R10: 00000000004002c8 R11: 0000000000000207 R12: 0000000000401850
R13: 00000000004018e0 R14: 0000000000000000 R15: 0000000000000000

Uninit was created at:
 kmsan_save_stack_with_flags mm/kmsan/kmsan.c:278 [inline]
 kmsan_internal_poison_shadow+0xb8/0x1b0 mm/kmsan/kmsan.c:188
 kmsan_kmalloc+0x94/0x100 mm/kmsan/kmsan.c:314
 __kmalloc+0x23c/0x350 mm/slub.c:3791
 kmalloc include/linux/slab.h:517 [inline]
 sock_kmalloc+0x14e/0x270 net/core/sock.c:1986
 af_alg_get_rsgl+0x427/0xe10 crypto/af_alg.c:1149
 _aead_recvmsg crypto/algif_aead.c:163 [inline]
 aead_recvmsg+0x953/0x2960 crypto/algif_aead.c:334
 aead_recvmsg_nokey+0x129/0x160 crypto/algif_aead.c:452
 sock_recvmsg_nosec net/socket.c:803 [inline]
 sock_recvmsg+0x1d0/0x230 net/socket.c:810
 ___sys_recvmsg+0x3fb/0x810 net/socket.c:2205
 __sys_recvmsg net/socket.c:2250 [inline]
 SYSC_recvmsg+0x298/0x3c0 net/socket.c:2262
 SyS_recvmsg+0x54/0x80 net/socket.c:2257
 do_syscall_64+0x309/0x430 arch/x86/entry/common.c:287
 entry_SYSCALL_64_after_hwframe+0x3d/0xa2
==================================================================

Crashes (640):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/04/07 23:37 https://github.com/google/kmsan.git master e2ab7e8abba4 66f22a7f .config console log report syz C ci-upstream-kmsan-gce
2018/07/24 09:46 https://github.com/google/kmsan.git master d1c2a46a46f6 912c93d7 .config console log report ci-upstream-kmsan-gce
2018/07/24 05:44 https://github.com/google/kmsan.git master d1c2a46a46f6 912c93d7 .config console log report ci-upstream-kmsan-gce
2018/07/24 03:31 https://github.com/google/kmsan.git master d1c2a46a46f6 912c93d7 .config console log report ci-upstream-kmsan-gce
2018/07/24 02:19 https://github.com/google/kmsan.git master d1c2a46a46f6 912c93d7 .config console log report ci-upstream-kmsan-gce
2018/07/24 00:41 https://github.com/google/kmsan.git master d1c2a46a46f6 912c93d7 .config console log report ci-upstream-kmsan-gce
2018/07/23 22:52 https://github.com/google/kmsan.git master d1c2a46a46f6 912c93d7 .config console log report ci-upstream-kmsan-gce
2018/07/23 19:27 https://github.com/google/kmsan.git master d1c2a46a46f6 f69c5fcd .config console log report ci-upstream-kmsan-gce
2018/07/23 13:54 https://github.com/google/kmsan.git master d1c2a46a46f6 f69c5fcd .config console log report ci-upstream-kmsan-gce
2018/07/23 06:51 https://github.com/google/kmsan.git master d1c2a46a46f6 8cc079c3 .config console log report ci-upstream-kmsan-gce
2018/07/23 05:11 https://github.com/google/kmsan.git master d1c2a46a46f6 8cc079c3 .config console log report ci-upstream-kmsan-gce
2018/07/23 03:02 https://github.com/google/kmsan.git master d1c2a46a46f6 8cc079c3 .config console log report ci-upstream-kmsan-gce
2018/07/23 01:05 https://github.com/google/kmsan.git master d1c2a46a46f6 8cc079c3 .config console log report ci-upstream-kmsan-gce
2018/07/22 23:31 https://github.com/google/kmsan.git master d1c2a46a46f6 8cc079c3 .config console log report ci-upstream-kmsan-gce
2018/07/22 20:14 https://github.com/google/kmsan.git master d1c2a46a46f6 8cc079c3 .config console log report ci-upstream-kmsan-gce
2018/07/22 14:54 https://github.com/google/kmsan.git master d1c2a46a46f6 8cc079c3 .config console log report ci-upstream-kmsan-gce
2018/07/22 13:45 https://github.com/google/kmsan.git master d1c2a46a46f6 8cc079c3 .config console log report ci-upstream-kmsan-gce
2018/07/22 03:57 https://github.com/google/kmsan.git master d1c2a46a46f6 8cc079c3 .config console log report ci-upstream-kmsan-gce
2018/07/21 21:10 https://github.com/google/kmsan.git master d1c2a46a46f6 8cc079c3 .config console log report ci-upstream-kmsan-gce
2018/07/21 19:23 https://github.com/google/kmsan.git master d1c2a46a46f6 8cc079c3 .config console log report ci-upstream-kmsan-gce
2018/07/21 16:47 https://github.com/google/kmsan.git master d1c2a46a46f6 8cc079c3 .config console log report ci-upstream-kmsan-gce
2018/07/21 15:36 https://github.com/google/kmsan.git master d1c2a46a46f6 8cc079c3 .config console log report ci-upstream-kmsan-gce
2018/07/21 12:27 https://github.com/google/kmsan.git master d1c2a46a46f6 8cc079c3 .config console log report ci-upstream-kmsan-gce
2018/07/21 10:55 https://github.com/google/kmsan.git master d1c2a46a46f6 8cc079c3 .config console log report ci-upstream-kmsan-gce
2018/07/21 07:32 https://github.com/google/kmsan.git master d1c2a46a46f6 8cc079c3 .config console log report ci-upstream-kmsan-gce
2018/07/21 06:26 https://github.com/google/kmsan.git master d1c2a46a46f6 af255b09 .config console log report ci-upstream-kmsan-gce
2018/07/21 06:00 https://github.com/google/kmsan.git master d1c2a46a46f6 af255b09 .config console log report ci-upstream-kmsan-gce
2018/07/21 02:58 https://github.com/google/kmsan.git master d1c2a46a46f6 af255b09 .config console log report ci-upstream-kmsan-gce
2018/07/20 22:23 https://github.com/google/kmsan.git master d1c2a46a46f6 af255b09 .config console log report ci-upstream-kmsan-gce
2018/07/20 21:02 https://github.com/google/kmsan.git master d1c2a46a46f6 af255b09 .config console log report ci-upstream-kmsan-gce
2018/07/20 19:44 https://github.com/google/kmsan.git master d1c2a46a46f6 af255b09 .config console log report ci-upstream-kmsan-gce
2018/07/20 15:43 https://github.com/google/kmsan.git master cf8cd3cd03e2 49f35839 .config console log report ci-upstream-kmsan-gce
2018/07/20 13:11 https://github.com/google/kmsan.git master cf8cd3cd03e2 49f35839 .config console log report ci-upstream-kmsan-gce
2018/07/20 11:25 https://github.com/google/kmsan.git master cf8cd3cd03e2 49f35839 .config console log report ci-upstream-kmsan-gce
2018/07/20 09:13 https://github.com/google/kmsan.git master cf8cd3cd03e2 49f35839 .config console log report ci-upstream-kmsan-gce
2018/07/20 06:10 https://github.com/google/kmsan.git master cf8cd3cd03e2 49f35839 .config console log report ci-upstream-kmsan-gce
2018/07/20 03:50 https://github.com/google/kmsan.git master cf8cd3cd03e2 49f35839 .config console log report ci-upstream-kmsan-gce
2018/07/20 01:11 https://github.com/google/kmsan.git master cf8cd3cd03e2 49f35839 .config console log report ci-upstream-kmsan-gce
2018/07/19 23:27 https://github.com/google/kmsan.git master cf8cd3cd03e2 49f35839 .config console log report ci-upstream-kmsan-gce
2018/07/19 21:37 https://github.com/google/kmsan.git master cf8cd3cd03e2 49f35839 .config console log report ci-upstream-kmsan-gce
2018/07/19 20:06 https://github.com/google/kmsan.git master cf8cd3cd03e2 49f35839 .config console log report ci-upstream-kmsan-gce
2018/07/19 19:33 https://github.com/google/kmsan.git master cf8cd3cd03e2 49f35839 .config console log report ci-upstream-kmsan-gce
2018/07/19 18:24 https://github.com/google/kmsan.git master cf8cd3cd03e2 49f35839 .config console log report ci-upstream-kmsan-gce
2018/07/19 15:27 https://github.com/google/kmsan.git master cf8cd3cd03e2 49f35839 .config console log report ci-upstream-kmsan-gce
2018/07/19 14:23 https://github.com/google/kmsan.git master cf8cd3cd03e2 49f35839 .config console log report ci-upstream-kmsan-gce
2018/07/19 09:12 https://github.com/google/kmsan.git master 80ecacc456c1 49f35839 .config console log report ci-upstream-kmsan-gce
2018/04/07 01:03 https://github.com/google/kmsan.git master e2ab7e8abba4 d613535f .config console log report ci-upstream-kmsan-gce
* Struck through repros no longer work on HEAD.