Re: [PATCH v2 2/2] x86: Rewrite ret_from_fork() in C

From: Peter Zijlstra
Date: Wed Jul 19 2023 - 16:41:31 EST


On Wed, Jul 19, 2023 at 04:33:26PM -0400, Joe Lawrence wrote:
> On 7/19/23 11:21, Petr Mladek wrote:
> > On Fri 2023-06-23 18:55:29, Brian Gerst wrote:
> >> When kCFI is enabled, special handling is needed for the indirect call
> >> to the kernel thread function. Rewrite the ret_from_fork() function in
> >> C so that the compiler can properly handle the indirect call.
> >
> > This patch broke livepatching. Kthreads never have a reliable stack.
> > It works when I revert it.
> >
>
> Just curious -- did the selftests catch this anywhere? I'm not 100%
> clear on what trees / frequency they all run, so maybe Petr you found
> this by code inspection or other means?

I suspect Petr ran the selftests himself, they're fairly easy to run
(once you figure out the magic incantation) and insta fail.

I'm not sure the robots consistently run this stuff -- I've had these
patches exposed to 0day for weeks...