All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Lawrence <joe.lawrence@redhat.com>
To: Ryan Sullivan <rysulliv@redhat.com>,
	live-patching@vger.kernel.org, linuxppc-dev@lists.ozlabs.org
Cc: pmladek@suse.com, mbenes@suse.cz, jikos@kernel.org,
	jpoimboe@kernel.org, naveen.n.rao@linux.ibm.com,
	christophe.leroy@csgroup.eu, mpe@ellerman.id.au,
	npiggin@gmail.com
Subject: Re: [PATCH] powerpc/ftrace: restore r2 to caller's stack on livepatch sibling call
Date: Thu, 15 Aug 2024 12:24:47 -0400	[thread overview]
Message-ID: <9ec85e72-85dd-e9bc-6531-996413014629@redhat.com> (raw)
In-Reply-To: <20240815160712.4689-1-rysulliv@redhat.com>

On 8/15/24 12:07, Ryan Sullivan wrote:
> Hi Michael,
> 
> The r2 value is stored to the livepatch stack prior to entering into 
> the livepatched code, so accessing it will gurantee the previous value
> is restored.
> 
> Also, yes, this bug is caused by tooling that "scoops out" pre-compiled
> code and places it into the livepatch handler (e.g. kpatch). However, 
> since the large majority of customers interact with the livepatch 
> subsystem through tooling, and this fix would not pose any serious risk
> to either usability or security (other than those already present in 
> livepatching), plus it would solve a large problem for these tools with
> a simple fix, I feel as though this would be a useful update to 
> livepatch.
> 

Right, for kpatch-build binary-diff livepatch creation, the tooling
scans modified code for a sibling call pattern and errors out with a
report to the user:

https://github.com/dynup/kpatch/blob/master/kpatch-build/create-diff-object.c#L3886

and we advise users to manually turn sibling calls off as needed:

https://github.com/dynup/kpatch/blob/master/doc/patch-author-guide.md#sibling-calls

If I understand Ryan's patch, it would remove this restriction from
kpatch creation -- assuming that it is safe and sane for the kernel's
ftrace handler to do so.

-- 
Joe


  reply	other threads:[~2024-08-15 16:24 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-24 18:33 [PATCH] powerpc/ftrace: restore r2 to caller's stack on livepatch sibling call Ryan Sullivan
2024-07-24 18:33 ` Ryan Sullivan
2024-07-29 14:17 ` Michael Ellerman
2024-07-29 14:17   ` Michael Ellerman
2024-07-29 15:02   ` Ryan Sullivan
2024-07-29 15:02     ` Ryan Sullivan
2024-08-15 10:22     ` Michael Ellerman
2024-08-15 16:07       ` Ryan Sullivan
2024-08-15 16:24         ` Joe Lawrence [this message]
2024-09-09 16:33           ` Ryan B. Sullivan
2024-09-10  7:21             ` Michael Ellerman
2024-09-10 15:02               ` Ryan B. Sullivan
2024-08-08  7:00 ` Christophe Leroy
2024-08-08  7:00   ` Christophe Leroy
2024-08-08 17:55   ` [PATCH v2] powerpc/ftrace: restore caller's toc on ppc64 " Ryan Sullivan
2024-08-08 17:55     ` Ryan Sullivan
2024-08-08 21:17   ` Ryan Sullivan
2024-08-08 21:17     ` Ryan Sullivan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9ec85e72-85dd-e9bc-6531-996413014629@redhat.com \
    --to=joe.lawrence@redhat.com \
    --cc=christophe.leroy@csgroup.eu \
    --cc=jikos@kernel.org \
    --cc=jpoimboe@kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=live-patching@vger.kernel.org \
    --cc=mbenes@suse.cz \
    --cc=mpe@ellerman.id.au \
    --cc=naveen.n.rao@linux.ibm.com \
    --cc=npiggin@gmail.com \
    --cc=pmladek@suse.com \
    --cc=rysulliv@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.