Thread (12 messages) 12 messages, 4 authors, 2024-09-10

Re: [PATCH] powerpc/ftrace: restore r2 to caller's stack on livepatch sibling call

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2024-08-15 10:22:21
Also in: live-patching

Ryan Sullivan [off-list ref] writes:
Hello Michael,

In the case of no sibling call within the livepatch then the store is
only "restoring" the r2 value that was already there as it is stored
and retrieved from the livepatch stack.
But what guarantee do we have that it's the value that was already
there?

Notice that the current livepatch_handler doesn't store to the (normal)
stack at all, because it doesn't know the context it's called in.

Does kpatch do anything special to induce the sibling call? Is it doing
objcopy or anything else weird?

I tried writing a selftest (in tools/testing/selftests/livepatch) to
trigger this case but couldn't get it to work. The compiler never
generates a sibling call across modules.

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help