Kernel panic when kasan is applied

515 views
Skip to first unread message

proline jung

unread,
Apr 4, 2017, 4:44:38 AM4/4/17
to syzkaller
I built kernel follow wiki (https://github.com/google/syzkaller/wiki/Setup:-Ubuntu-host,-QEMU-vm,-x86_64-kernel), but always occur kernel panic.

follow attachments are my boot log and config file

anyone know about this problem?

[    1.493495] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
[    1.497110] task: ffff88006c6a8040 task.stack: ffff88006c6b0000
[    1.506767] RIP: 0010:__memset+0x24/0x30
[    1.508983] RSP: 0000:ffff88006c6b7e78 EFLAGS: 00010206
[    1.511810] RAX: 0000000000000000 RBX: dffffc0000000009 RCX: 0000000000000001
[    1.515346] RDX: 0000000000000000 RSI: 0000000000000000 RDI: dffffc0000000001
[    1.517358] RBP: ffff88006c6b7e90 R08: 0000000000000000 R09: dffffc0000000001
[    1.519236] R10: 000000005dc38e94 R11: ffff88006c0288b8 R12: 0000000000000040
[    1.521054] R13: dffffc0000000000 R14: 0000000000000040 R15: 0000000000000002
[    1.522897] FS:  0000000000000000(0000) GS:ffff88006d200000(0000) knlGS:0000000000000000
[    1.525050] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    1.526636] CR2: 00000000ffffffff CR3: 000000000260e000 CR4: 00000000000006f0
[    1.528599] Call Trace:
[    1.529311]  ? kasan_unpoison_shadow+0x35/0x50
[    1.530522]  __asan_register_globals+0x47/0x90
[    1.531705]  _GLOBAL__sub_I_65535_1_envp_init+0x15/0x20
[    1.533084]  kernel_init_freeable+0x180/0x2e7
[    1.534304]  ? schedule_tail+0x3f/0x80
[    1.535353]  ? rest_init+0x90/0x90
[    1.536259]  kernel_init+0xe/0x120
[    1.537188]  ? rest_init+0x90/0x90
[    1.538291]  ret_from_fork+0x2c/0x40
[    1.540694] Code: 90 90 90 90 90 90 90 0f 1f 44 00 00 49 89 f9 48 89 d1 83 e2 07 48 c1 e9 03 40 0f b6 f6 48 b8 01 01 01 01 01 01 01 01 48 0f af c6 <f3> 48 ab 89 d1 f3 aa 4c 89 c8 c3 90 49 89 f9 40 88 f0 48 89 d1 
[    1.549207] RIP: __memset+0x24/0x30 RSP: ffff88006c6b7e78
[    1.550575] ---[ end trace a590f20c8c3c7f5e ]---
[    1.552007] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
[    1.552007] 
[    1.554449] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
[    1.554449] 
qemu: terminating on signal 15 from pid 99915



config
vm.log

Dmitry Vyukov

unread,
Apr 4, 2017, 4:59:21 AM4/4/17
to proline jung, syzkaller, kasan-dev
+kasan-dev

Hi proline,

This happens due to ABI mismatch between compiler and kernel. This is
known to happen with old kernel+new gcc, or with unreleased versions
of gcc. What is your kernel and gcc? Try to update gcc if it's old.

proline jung

unread,
Apr 4, 2017, 5:05:14 AM4/4/17
to syzkaller
my kernel version is 4.10.8 and gcc 7.0.0 
but when kasan is not applied, kernel is work well

Dmitry Vyukov

unread,
Apr 4, 2017, 5:12:46 AM4/4/17
to proline jung, syzkaller, kasan-dev
On Tue, Apr 4, 2017 at 11:05 AM, proline jung <exso...@gmail.com> wrote:
> my kernel version is 4.10.8 and gcc 7.0.0
> but when kasan is not applied, kernel is work well


+kasan-dev again

Yes, I understand that it works without KASAN. The ABI mismatch
relates to KASAN datastructures.
Please try the following patch:

diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index 0efef9cf014f..c50f7653dd7f 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -278,7 +278,7 @@
#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP && !__CHECKER__ */

#if GCC_VERSION >= 70000
-#define KASAN_ABI_VERSION 5
+#define KASAN_ABI_VERSION 4
#elif GCC_VERSION >= 50000
#define KASAN_ABI_VERSION 4
#elif GCC_VERSION >= 40902

proline jung

unread,
Apr 4, 2017, 8:29:41 PM4/4/17
to syzkaller
Dmitry Vyukov, Thank you for your advice!!
I't work!

2017년 4월 4일 화요일 오후 6시 12분 46초 UTC+9, Dmitry Vyukov 님의 말:

lixing...@gmail.com

unread,
Jan 20, 2020, 1:16:41 PM1/20/20
to syzkaller
Hi,
When I use GCC 7.4 to compile linux4.8-rc1, it has the same issue. But in include/linux/compiler-gcc.h:
#if GCC_VERSION >= 50000
#define KASAN_ABI_VERSION 4
#elif GCC_VERSION >= 40902
#define KASAN_ABI_VERSION 3
#endif
How should I fix?
Thanks 
在 2017年4月4日星期二 UTC-7上午2:12:46,Dmitry Vyukov写道:

dd x

unread,
Jan 2, 2021, 8:35:31 AM1/2/21
to syzkaller
Hello, I encountered the same problem as you. Did you solve it? 
Looking forward to your reply, thank you!
Reply all
Reply to author
Forward
0 new messages