From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qc0-f181.google.com ([209.85.216.181]:64269 "EHLO mail-qc0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753872AbaIZRHZ (ORCPT ); Fri, 26 Sep 2014 13:07:25 -0400 Received: by mail-qc0-f181.google.com with SMTP id w7so4085212qcr.26 for ; Fri, 26 Sep 2014 10:07:24 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <54259BD4.8090508@oracle.com> References: <1404905415-9046-1-git-send-email-a.ryabinin@samsung.com> <1411562649-28231-1-git-send-email-a.ryabinin@samsung.com> <54259BD4.8090508@oracle.com> From: Dmitry Vyukov Date: Fri, 26 Sep 2014 10:07:04 -0700 Message-ID: Subject: Re: [PATCH v3 00/13] Kernel address sanitizer - runtime memory debugger. Content-Type: text/plain; charset=UTF-8 Sender: linux-kbuild-owner@vger.kernel.org List-ID: To: Sasha Levin Cc: Andrey Ryabinin , LKML , Konstantin Serebryany , Dmitry Chernenkov , Andrey Konovalov , Yuri Gribov , Konstantin Khlebnikov , Michal Marek , Thomas Gleixner , Ingo Molnar , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Dave Hansen , Andi Kleen , Vegard Nossum , "H. Peter Anvin" , linux-kbuild@vger.kernel.org, x86@kernel.org, linux-mm@kvack.org, Randy Dunlap , Peter Zijlstra , Alexander Viro , Dave Jones On Fri, Sep 26, 2014 at 10:01 AM, Sasha Levin wrote: > On 09/24/2014 08:43 AM, Andrey Ryabinin wrote: >> Hi. >> >> This is a third iteration of kerenel address sanitizer (KASan). >> >> KASan is a runtime memory debugger designed to find use-after-free >> and out-of-bounds bugs. >> >> Currently KASAN supported only for x86_64 architecture and requires kernel >> to be build with SLUB allocator. >> KASAN uses compile-time instrumentation for checking every memory access, therefore you >> will need a fresh GCC >= v5.0.0. > > Hi Andrey, > > I tried this patchset, with the latest gcc, and I'm seeing the following: > > arch/x86/kernel/head.o: In function `_GLOBAL__sub_I_00099_0_reserve_ebda_region': > /home/sasha/linux-next/arch/x86/kernel/head.c:71: undefined reference to `__asan_init_v4' > init/built-in.o: In function `_GLOBAL__sub_I_00099_0___ksymtab_system_state': > /home/sasha/linux-next/init/main.c:1034: undefined reference to `__asan_init_v4' > init/built-in.o: In function `_GLOBAL__sub_I_00099_0_init_uts_ns': > /home/sasha/linux-next/init/version.c:50: undefined reference to `__asan_init_v4' > init/built-in.o: In function `_GLOBAL__sub_I_00099_0_root_mountflags': > /home/sasha/linux-next/init/do_mounts.c:638: undefined reference to `__asan_init_v4' > init/built-in.o: In function `_GLOBAL__sub_I_00099_0_rd_prompt': > /home/sasha/linux-next/init/do_mounts_rd.c:361: undefined reference to `__asan_init_v4' > init/built-in.o:/home/sasha/linux-next/init/do_mounts_md.c:312: more undefined references to `__asan_init_v4' follow > > > What am I missing? Emission of __asan_init_vx needs to be disabled when -fsanitize=kernel-address. Our kernel does not boot with them at all. It probably hits some limit for something that can be increased. But I don't want to investigate what that limit is, as __asan_init is not needed for kasan at all.