lkml.org 
[lkml]   [2020]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCH] ACPICA: fix UBSAN warning using __builtin_offsetof
    On Mon, Jun 1, 2020 at 4:37 PM Peter Collingbourne <pcc@google.com> wrote:
    >
    > On Mon, Jun 1, 2020 at 4:18 PM Nick Desaulniers <ndesaulniers@google.com> wrote:
    > >
    > > Will reported UBSAN warnings:
    > > UBSAN: null-ptr-deref in drivers/acpi/acpica/tbfadt.c:459:37
    > > UBSAN: null-ptr-deref in arch/arm64/kernel/smp.c:596:6
    > >
    > > Looks like the emulated offsetof macro ACPI_OFFSET is causing these. We
    > > can avoid this by using the compiler builtin, __builtin_offsetof.
    >
    > Would it be better to s/ACPI_OFFSET/offsetof/g the existing users of
    > this macro and remove it? It looks like offsetof is already being used
    > pervasively in the kernel, and its definition comes from
    > <linux/stddef.h>.

    I count only 9 uses in the tree, so not too bad a yak shave. Good
    idea; I'll send tomorrow short of any other feedback. I still think
    we want the builtin, since we don't want to include stddef.h in the
    kernel, I think.
    --
    Thanks,
    ~Nick Desaulniers

    \
     
     \ /
      Last update: 2020-06-02 01:49    [W:4.076 / U:0.912 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site