lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zr3TrqIWrEvuj2-b@pathway.suse.cz>
Date: Thu, 15 Aug 2024 12:08:46 +0200
From: Petr Mladek <pmladek@...e.com>
To: Miroslav Benes <mbenes@...e.cz>
Cc: Josh Poimboeuf <jpoimboe@...nel.org>,
	Joe Lawrence <joe.lawrence@...hat.com>,
	Nicolai Stange <nstange@...e.de>, live-patching@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [POC 0/7] livepatch: Make livepatch states, callbacks, and
 shadow variables work together

On Thu 2024-07-25 16:19:30, Miroslav Benes wrote:
> On Fri, 10 Nov 2023, Josh Poimboeuf wrote:
> 
> > On Fri, Nov 10, 2023 at 06:04:21PM +0100, Petr Mladek wrote:
> > > This POC is a material for the discussion "Simplify Livepatch Callbacks,
> > > Shadow Variables, and States handling" at LPC 2013, see
> > > https://lpc.events/event/17/contributions/1541/
> > > 
> > > It obsoletes the patchset adding the garbage collection of shadow
> > > variables. This new solution is based on ideas from Nicolai Stange.
> > > And it should also be in sync with Josh's ideas mentioned into
> > > the thread about the garbage collection, see
> > > https://lore.kernel.org/r/20230204235910.4j4ame5ntqogqi7m@treble
> > 
> > Nice!  I like how it brings the "features" together and makes them easy
> > to use.  This looks like a vast improvement.
> > 
> > Was there a reason to change the naming?  I'm thinking
> > 
> >   setup / enable / disable / release
> > 
> > is less precise than
> > 
> >   pre_patch / post_patch / pre_unpatch / post_unpatch.

I wanted to point out that the callbacks are called _only_ when
the states are added or removed. They are not called when the state
is preserved during the atomic replace.

The pre_patch... naming scheme might create an assumption that they
are _always_ called during the livepatch transition.

But I see that the new names might be misleading in other ways.

I am going to use the "pre_patch..." names in the next version of
the patchset.


> > Also, I'm thinking "replaced" instead of "obsolete" would be more
> > consistent with the existing terminology.
> > 
> > For example, in __klp_enable_patch():
> > 
> > 	ret = klp_setup_states(patch);
> > 	if (ret)
> > 		goto err;
> > 
> > 	if (patch->replace)
> > 		klp_disable_obsolete_states(patch);
> > 
> > it's not immediately clear why "disable obsolete" would be the "replace"
> > counterpart to "setup".
> > 
> > Similarly, in klp_complete_transition():
> > 
> > 	if (klp_transition_patch->replace && klp_target_state == KLP_PATCHED) {
> > 		klp_unpatch_replaced_patches(klp_transition_patch);
> > 		klp_discard_nops(klp_transition_patch);
> > 		klp_release_obsolete_states(klp_transition_patch);
> > 	}
> > 
> > it's a little jarring to have "unpatch replaced" followed by "release
> > obsolete".

I see.

> I agree. I would also stick to the existing naming. It is clearer to me.

Fair enough.

Best Regards,
Petr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ