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]
Date:	Tue, 10 Feb 2015 13:57:06 -0600
From:	Josh Poimboeuf <jpoimboe@...hat.com>
To:	Jiri Slaby <jslaby@...e.cz>
Cc:	Seth Jennings <sjenning@...hat.com>, Jiri Kosina <jkosina@...e.cz>,
	Vojtech Pavlik <vojtech@...e.cz>,
	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
	live-patching@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 8/9] livepatch: allow patch modules to be removed

On Tue, Feb 10, 2015 at 08:02:34PM +0100, Jiri Slaby wrote:
> On 02/09/2015, 06:31 PM, Josh Poimboeuf wrote:
> > --- a/kernel/livepatch/core.c
> > +++ b/kernel/livepatch/core.c
> ...
> > @@ -497,10 +500,6 @@ static struct attribute *klp_patch_attrs[] = {
> >  
> >  static void klp_kobj_release_patch(struct kobject *kobj)
> >  {
> > -	/*
> > -	 * Once we have a consistency model we'll need to module_put() the
> > -	 * patch module here.  See klp_register_patch() for more details.
> > -	 */
> 
> I deliberately let you write the note in there :). What happens when I
> leave some attribute in /sys open and you remove the module in the meantime?

You're right, as was I the first time :-)

The only problem is that it would be nice if we could call
klp_unregister_patch() from the patch module's exit function, so that
doing an rmmod on the patch module unregisters it.  But if we put
module_put() in the patch release function, then we have a circular
dependency and we could never rmmod it.

How about instead we do a klp_is_patch_registered() at the beginning of
all the attribute accessor functions?  It's kind of ugly, but I can't
think of a better idea at the moment.

-- 
Josh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ