lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANpmjNOjY-XaJqGzQW7=EDWPuEfOSyGCSLUKLj++WAKRS2EmAQ@mail.gmail.com>
Date: Tue, 17 Dec 2024 09:30:24 +0100
From: Marco Elver <elver@...gle.com>
To: Arnd Bergmann <arnd@...nel.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>, Andrey Konovalov <andreyknvl@...il.com>, 
	Josh Poimboeuf <jpoimboe@...nel.org>, Peter Zijlstra <peterz@...radead.org>, 
	Arnd Bergmann <arnd@...db.de>, Dmitry Vyukov <dvyukov@...gle.com>, Aleksandr Nogikh <nogikh@...gle.com>, 
	kasan-dev@...glegroups.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] kcov: mark in_softirq_really() as __always_inline

On Tue, 17 Dec 2024 at 08:18, Arnd Bergmann <arnd@...nel.org> wrote:
>
> From: Arnd Bergmann <arnd@...db.de>
>
> If gcc decides not to inline in_softirq_really(), objtool warns about
> a function call with UACCESS enabled:
>
> kernel/kcov.o: warning: objtool: __sanitizer_cov_trace_pc+0x1e: call to in_softirq_really() with UACCESS enabled
> kernel/kcov.o: warning: objtool: check_kcov_mode+0x11: call to in_softirq_really() with UACCESS enabled
>
> Mark this as __always_inline to avoid the problem.
>
> Fixes: 7d4df2dad312 ("kcov: properly check for softirq context")
> Signed-off-by: Arnd Bergmann <arnd@...db.de>

__always_inline is the usual approach for code that can be
instrumented - but I thought we explicitly never instrument
kernel/kcov.c with anything. So I'm rather puzzled why gcc would not
inline this function. In any case "inline" guarantees nothing, so:

Reviewed-by: Marco Elver <elver@...gle.com>

> ---
>  kernel/kcov.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/kcov.c b/kernel/kcov.c
> index 28a6be6e64fd..187ba1b80bda 100644
> --- a/kernel/kcov.c
> +++ b/kernel/kcov.c
> @@ -166,7 +166,7 @@ static void kcov_remote_area_put(struct kcov_remote_area *area,
>   * Unlike in_serving_softirq(), this function returns false when called during
>   * a hardirq or an NMI that happened in the softirq context.
>   */
> -static inline bool in_softirq_really(void)
> +static __always_inline bool in_softirq_really(void)
>  {
>         return in_serving_softirq() && !in_hardirq() && !in_nmi();
>  }
> --
> 2.39.5
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ