Re: [GIT PULL] x86/urgent for v6.3-rc7
From: Borislav Petkov
Date: Mon Apr 17 2023 - 05:04:31 EST
On Sun, Apr 16, 2023 at 10:33:19AM -0700, Linus Torvalds wrote:
> On Sun, Apr 16, 2023 at 5:29 AM Borislav Petkov <bp@xxxxxxxxx> wrote:
> >
> > - Drop __init annotation from two rtc functions which get called after
> > boot is done, in order to prevent a crash
>
> .. ahh, and our automation to catch these things didn't find it,
> because they are only accessed from x86_wallclock_init(), which is
> also __init.
>
> So it all looked superficially good, except for the "oh, we saved them
> into a data structure that _isn't_ init".
>
> It would require automation much smarter than the one we have to catch
> that kind of thing.
Looking at
objdump -D arch/x86/kernel/x86_init.o
output, all the info is there in order to check whether a function ptr from
a .init section gets assigned to .data section structure.
Question is whether this is worth to put into objtool. From all the
objtool code I've seen flying by in recent years, we should pretty much
have everything needed so it should relatively easy to do.
But lemme add Josh and Peter...
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette