From: "Arnd Bergmann" <arnd@arndb.de>
To: "Heiko Carstens" <hca@linux.ibm.com>, "Arnd Bergmann" <arnd@kernel.org>
Cc: linux-hardening@vger.kernel.org, linux-s390@vger.kernel.org,
"Kees Cook" <kees@kernel.org>, "Marco Elver" <elver@google.com>,
"Andrey Konovalov" <andreyknvl@gmail.com>,
"Andrey Ryabinin" <ryabinin.a.a@gmail.com>,
kasan-dev@googlegroups.com, "Vasily Gorbik" <gor@linux.ibm.com>,
"Alexander Gordeev" <agordeev@linux.ibm.com>,
"Christian Borntraeger" <borntraeger@linux.ibm.com>,
"Sven Schnelle" <svens@linux.ibm.com>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Nick Terrell" <terrelln@fb.com>,
"David Sterba" <dsterba@suse.com>,
"Nathan Chancellor" <nathan@kernel.org>,
linux-kernel@vger.kernel.org,
"Peter Zijlstra" <peterz@infradead.org>,
"Stefan Schulze Frielinghaus" <stefansf@linux.ibm.com>,
"Juergen Christ" <jchrist@linux.ibm.com>
Subject: Re: [PATCH] [RFC] ubsan: turn off UBSAN_ALIGNMENT on s390
Date: Fri, 15 May 2026 22:51:02 +0200 [thread overview]
Message-ID: <5502d883-a7c4-4e14-8f27-7bffd1f4d35f@app.fastmail.com> (raw)
In-Reply-To: <20260515165357.10935D74-hca@linux.ibm.com>
On Fri, May 15, 2026, at 18:53, Heiko Carstens wrote:
> On Fri, May 15, 2026 at 11:19:54AM +0200, Arnd Bergmann wrote:
>> From: Arnd Bergmann <arnd@arndb.de>
>>
>> Testing randconfig builds on s390 with gcc-15, I came across a number of
>> seemingly unrelated build failures that ended up all being caused
>> by the -fsanitize=alignment option:
>>
>> s390-linux-ld: kernel/sched/build_policy.o: in function `thread_group_cputime':
>> include/linux/seqlock.h:1286:(.text+0x1f738): undefined reference to `__scoped_seqlock_bug'
>
> Does this only happen with __scoped_seqlock_bug()?
> I just enabled UBSAN_ALIGNMENT, and with gcc-16 I can see this too.
Yes, it's specifically this one file that triggers the
__scoped_seqlock_bug check.
>> --- a/lib/Kconfig.ubsan
>> +++ b/lib/Kconfig.ubsan
>> @@ -152,6 +152,7 @@ config UBSAN_ENUM
>>
>> config UBSAN_ALIGNMENT
>> bool "Perform checking for misaligned pointer usage"
>> + depends on !S390 || BROKEN
>
> Wouldn't it be more appropriate to extend the ifdef at __scoped_seqlock_bug()
> which emits an empty function for exactly this reason for some gcc versions
> and kernel configs?
>
> That is: add CONFIG_UBSAN_ALIGNMENT to the list (copy-pasted - white space
> damage below)?
This would work around the failed check in kernel/sched/build_policy.o
but not address the underlying issue, or any other the other symptoms.
After trying to come up with a simplified test case that shows
a problem on s390 but not arm64, I have now realized what is going
on: My randconfig build script force-enables 'CONFIG_COMPILE_TEST=y'
on all architectures, in order to avoid known-broken configurations
and options that lead to a longer build time but are unlikely
to find additional bugs. UBSAN_ALIGNMENT in turn depends on
!COMPILE_TEST as of d0a3ac549f38 ("ubsan: enable for all*config
builds"). On s390, COMPILE_TEST is unavailable when MMIO is
disabled, so randconfig builds sometimes run into those broken
configurations on s390 that I don't see elsewhere.
I think your suggestion for __scoped_seqlock_bug makes sense,
and I've sent a fix for the fs/fat/ issue. I'll see if I can
also reproduce the other issues across architectures and come
up with local workarounds for UBSAN_ALIGNMENT.
Arnd
prev parent reply other threads:[~2026-05-15 20:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-15 9:19 [PATCH] [RFC] ubsan: turn off UBSAN_ALIGNMENT on s390 Arnd Bergmann
2026-05-15 16:53 ` Heiko Carstens
2026-05-15 20:51 ` Arnd Bergmann [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5502d883-a7c4-4e14-8f27-7bffd1f4d35f@app.fastmail.com \
--to=arnd@arndb.de \
--cc=agordeev@linux.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=andreyknvl@gmail.com \
--cc=arnd@kernel.org \
--cc=borntraeger@linux.ibm.com \
--cc=dsterba@suse.com \
--cc=elver@google.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=jchrist@linux.ibm.com \
--cc=kasan-dev@googlegroups.com \
--cc=kees@kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=nathan@kernel.org \
--cc=peterz@infradead.org \
--cc=ryabinin.a.a@gmail.com \
--cc=stefansf@linux.ibm.com \
--cc=svens@linux.ibm.com \
--cc=terrelln@fb.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox