Re: [GIT PULL] kmalloc_obj treewide refactor for v7.0-rc1

Linus Torvalds
2026-02-21T20:17:16Z

On Sat, 21 Feb 2026 at 11:49, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> So I've pulled this [..]

Uhhuh. Something funky is going on.

On my local build with clang and my local machine configuration, with
this pull I get

net/core/dev.o: warning: objtool: register_netdev+0x21:
register_netdevice() missing __noreturn in .c/.h or NORETURN() in
noreturns.h

net/core/dev.o: warning: objtool: unregister_netdev+0x45:
unregister_netdevice_many_notify() missing __noreturn in .c/.h or
NORETURN() in noreturns.h

which makes no sense to me at all, but it's repeatable. Without this
pull there are no objtool warnings, with this pull the above warning
happens.

There obviously are a number of conversions in that file, but none of
them should have *any* effect of any code generation that I can see.

So the fact that they clearly have some odd effect is a bit scary.

On a hunch, I reverted the two *_flex() conversions, and the problem went away.

And then I narrowed it down to *just* this hunk:

--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -6510,8 +6510,7 @@ struct flush_backlogs {

static struct flush_backlogs *flush_backlogs_alloc(void)
{
- return kmalloc(struct_size_t(struct flush_backlogs, w, nr_cpu_ids),
- GFP_KERNEL);
+ return kmalloc_flex(struct flush_backlogs, w, nr_cpu_ids, GFP_KERNEL);
}

static struct flush_backlogs *flush_backlogs_fallback;

which is what triggers it.

So there's something going on with this conversion, or there's another
clang bug lurking.

I'm not sure this is a fatal issue, but it makes me *very* nervous.

Because that objtool error screams "compiler generates garbage code" to me.

Linus