live-patching.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicolai Stange <nstange@suse.de>
To: Evgenii Shatokhin <eshatokhin@virtuozzo.com>
Cc: Miroslav Benes <mbenes@suse.cz>,
	live-patching@vger.kernel.org, pmladek@suse.com, nstange@suse.de
Subject: Re: Patching kthread functions
Date: Thu, 01 Oct 2020 14:43:58 +0200	[thread overview]
Message-ID: <87lfgqt8tt.fsf@suse.de> (raw)
In-Reply-To: <alpine.LSU.2.21.2010011300450.6689@pobox.suse.cz> (Miroslav Benes's message of "Thu, 1 Oct 2020 13:13:07 +0200 (CEST)")

Miroslav Benes <mbenes@suse.cz> writes:

> On Wed, 30 Sep 2020, Evgenii Shatokhin wrote:

>> Is that so? Are there any workarounds?
>
> Petr, do you remember the crazy workarounds we talked about? My head is 
> empty now. And I am sure, Nicolai could come up with something.

There might be some clever tricks ycou could play, but that depends on
the diff you want to turn into a livepatch. For example, sometimes it's
possible to livepatch a callee and make it trick the unpatchable caller
into the desired behaviour.

However, in your case it might be easier to simply kill the running
kthread and start it again, e.g. from a ->post_patch() callback. Note
that KLP's callbacks are a bit subtle though, at a minimum you'd
probably also want to implement ->pre_unpatch() to roll everything back
and perhaps also disable (->replace) downgrades by means of the klp_state API.

You can find some good docs on callbacks and klp_state at
Documentation/livepatch/.

Thanks,

Nicolai

-- 
SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg), GF: Felix Imendörffer

  reply	other threads:[~2020-10-01 12:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-30 15:44 Patching kthread functions Evgenii Shatokhin
2020-10-01 11:13 ` Miroslav Benes
2020-10-01 12:43   ` Nicolai Stange [this message]
2020-10-01 13:18     ` Evgenii Shatokhin
2020-10-01 13:12   ` Evgenii Shatokhin
2020-10-02 11:53     ` Miroslav Benes
2020-10-02 12:52       ` Evgenii Shatokhin
2020-10-02 13:06         ` Miroslav Benes
2020-10-01 14:46   ` Petr Mladek
2020-10-01 16:34     ` Evgenii Shatokhin

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=87lfgqt8tt.fsf@suse.de \
    --to=nstange@suse.de \
    --cc=eshatokhin@virtuozzo.com \
    --cc=live-patching@vger.kernel.org \
    --cc=mbenes@suse.cz \
    --cc=pmladek@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).