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: <6df09ea5-1478-476c-8bc2-16217a4db3a3@app.fastmail.com>
Date: Wed, 18 Dec 2024 09:49:46 +0100
From: "Arnd Bergmann" <arnd@...db.de>
To: "Josh Poimboeuf" <jpoimboe@...nel.org>, "Marco Elver" <elver@...gle.com>
Cc: "Arnd Bergmann" <arnd@...nel.org>,
 "Andrew Morton" <akpm@...ux-foundation.org>,
 "Andrey Konovalov" <andreyknvl@...il.com>,
 "Peter Zijlstra" <peterz@...radead.org>,
 "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 Wed, Dec 18, 2024, at 09:40, Josh Poimboeuf wrote:
> On Tue, Dec 17, 2024 at 09:30:24AM +0100, Marco Elver wrote:
>> 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:
>
> I'm guessing CONFIG_DEBUG_SECTION_MISMATCH was enabled, which enables
> -fno-inline-functions-called-once which ends up being the cause of a lot
> of these __always_inline patches.
>
> I had a patch to get rid of that at some point, guess it got lost...

It doesn't seem to be the cause here, I get the warning both with
and without CONFIG_DEBUG_SECTION_MISMATCH in random configurations.
I've attached one .config that shows the problem without this
option in case you want to investigate further.

     Arnd
Download attachment ".config.gz" of type "application/gzip" (38798 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ