[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANpmjNPTdnReD1rmdyGPvpOqp0N6yc=XMfmdnNdgVrptGTTaVQ@mail.gmail.com>
Date: Tue, 16 Dec 2025 11:18:43 +0100
From: Marco Elver <elver@...gle.com>
To: Brendan Jackman <jackmanb@...gle.com>, Andrew Morton <akpm@...ux-foundation.org>
Cc: Andrey Ryabinin <ryabinin.a.a@...il.com>, Alexander Potapenko <glider@...gle.com>,
Andrey Konovalov <andreyknvl@...il.com>, Dmitry Vyukov <dvyukov@...gle.com>,
Vincenzo Frascino <vincenzo.frascino@....com>, Ard Biesheuvel <ardb@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
"H. Peter Anvin" <hpa@...or.com>, Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <nick.desaulniers+lkml@...il.com>, Bill Wendling <morbo@...gle.com>,
Justin Stitt <justinstitt@...gle.com>, kasan-dev@...glegroups.com,
linux-kernel@...r.kernel.org, llvm@...ts.linux.dev
Subject: Re: [PATCH v3 0/3] Noinstr fixes for K[CA]SAN with GCOV
On Tue, 16 Dec 2025 at 11:16, Brendan Jackman <jackmanb@...gle.com> wrote:
>
> As discussed in [2], the GCOV+*SAN issue is attacked from two angles:
> both adding __always_inline to the instrumentation helpers AND disabling
> GCOV for noinstr.c. Only one or the other of these things is needed to
> make the build error go away, but they both make sense in their own
> right and both may serve to prevent other similar errors from cropping
> up in future.
>
> Note I have not annotated !CONFIG_* stubs, only !__SANITIZE_*__ ones.
> That's because for global settings (i.e. kconfig) it remains a bug to
> call these stubs from the wrong context and we'd probably like to detect
> that bug even if it could be eliminated from the current build.
>
> Concretely, the above is talking about KMSAN, i.e. stuff like
> instrument_copy_from_user().
>
> Other than that, I think everything in include/linux/instrumented.h is
> covered now.
>
> Signed-off-by: Brendan Jackman <jackmanb@...gle.com>
> ---
> Details:
>
> - ❯❯ clang --version
> Debian clang version 19.1.7 (3+build5)
> Target: x86_64-pc-linux-gnu
> Thread model: posix
> InstalledDir: /usr/lib/llvm-19/bin
>
> - Kernel config:
>
> https://gist.githubusercontent.com/bjackman/bbfdf4ec2e1dfd0e18657174f0537e2c/raw/a88dcc6567d14c69445e7928a7d5dfc23ca9f619/gistfile0.txt
>
> Note I also get this error:
>
> vmlinux.o: warning: objtool: set_ftrace_ops_ro+0x3b: relocation to !ENDBR: machine_kexec_prepare+0x810
>
> That one's a total mystery to me. I guess it's better to "fix" the SEV
> one independently rather than waiting until I know how to fix them both.
>
> Note I also mentioned other similar errors in [0]. Those errors don't
> exist in Linus' master and I didn't note down where I saw them. Either
> they have since been fixed, or I observed them in Google's internal
> codebase where they were instroduced downstream.
>
> Changes in v3:
> - Also fix __kcsan_{dis,en}able_current()
> - Link to v2: https://lore.kernel.org/r/20251215-gcov-inline-noinstr-v2-0-6f100b94fa99@google.com
Acked-by: Marco Elver <elver@...gle.com>
Thanks!
Powered by blists - more mailing lists