Re: [PATCH v2 1/2] x86/bug: Add printf() validation to HAVE_ARCH_BUG_FORMAT_ARGS WARNs

From: Sean Christopherson

Date: Thu Apr 23 2026 - 11:48:34 EST


On Thu, Apr 23, 2026, Dave Hansen wrote:
> On 4/23/26 07:54, Sean Christopherson wrote:
> > Lack of validation is especially problematic for code that is 64-bit-only,
> > as blatant goofs can easily go unnoticed, as they (somewhat ironically)
> > will only be noticed by CONFIG_BUG=n builds.
>
> This took me a minute to piece together.
>
> CONFIG_BUG=n builds use the asm-generic/bug.h implementations which have:
>
> no_printk(format);
>
> and do their own printk validation. Right?

Ya.

> Also, what do you mean about 64-bit-only code?

32-bit x86 doesn't support HAVE_ARCH_BUG_FORMAT_ARGS, and so it too uses generic
implementations that provide printk validation. I.e. the blind spot is code that
is strictly x86-64, because code that builds on other architectures and on 32-bit
x86 will be detected by those other builds, and unlike CONFIG_BUG=n, people and
bots regularly test those configurations.

> I'm also debating if we should stick these in x86/urgent and get them to
> Linus sooner rather than later so folks aren't bitten by this for a
> whole development cycle.