lkml.org 
[lkml]   [2017]   [Oct]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 05/11] Disable kasan's instrumentation
    Date
    From: Andrey Ryabinin <a.ryabinin@samsung.com>

    To avoid some build and runtime errors, compiler's instrumentation must
    be disabled for code not linked with kernel image.

    Cc: Andrey Ryabinin <a.ryabinin@samsung.com>
    Signed-off-by: Abbott Liu <liuwenliang@huawei.com>
    ---
    arch/arm/boot/compressed/Makefile | 1 +
    arch/arm/kernel/unwind.c | 3 ++-
    arch/arm/vdso/Makefile | 2 ++
    3 files changed, 5 insertions(+), 1 deletion(-)

    diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
    index d50430c..ab5693b 100644
    --- a/arch/arm/boot/compressed/Makefile
    +++ b/arch/arm/boot/compressed/Makefile
    @@ -23,6 +23,7 @@ OBJS += hyp-stub.o
    endif

    GCOV_PROFILE := n
    +KASAN_SANITIZE := n

    #
    # Architecture dependencies
    diff --git a/arch/arm/kernel/unwind.c b/arch/arm/kernel/unwind.c
    index 0bee233..2e55c7d 100644
    --- a/arch/arm/kernel/unwind.c
    +++ b/arch/arm/kernel/unwind.c
    @@ -249,7 +249,8 @@ static int unwind_pop_register(struct unwind_ctrl_block *ctrl,
    if (*vsp >= (unsigned long *)ctrl->sp_high)
    return -URC_FAILURE;

    - ctrl->vrs[reg] = *(*vsp)++;
    + ctrl->vrs[reg] = READ_ONCE_NOCHECK(*(*vsp));
    + (*vsp)++;
    return URC_OK;
    }

    diff --git a/arch/arm/vdso/Makefile b/arch/arm/vdso/Makefile
    index 59a8fa7..689dfec 100644
    --- a/arch/arm/vdso/Makefile
    +++ b/arch/arm/vdso/Makefile
    @@ -29,6 +29,8 @@ CFLAGS_vgettimeofday.o = -O2
    # Disable gcov profiling for VDSO code
    GCOV_PROFILE := n

    +KASAN_SANITIZE := n
    +
    # Force dependency
    $(obj)/vdso.o : $(obj)/vdso.so

    --
    2.9.0
    \
     
     \ /
      Last update: 2017-10-11 10:33    [W:4.064 / U:0.012 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site