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:   Wed, 1 May 2019 07:37:30 +1000
From:   "Tobin C. Harding" <me@...in.cc>
To:     Petr Mladek <pmladek@...e.com>
Cc:     "Tobin C. Harding" <tobin@...nel.org>,
        Josh Poimboeuf <jpoimboe@...hat.com>,
        Jiri Kosina <jikos@...nel.org>,
        Miroslav Benes <mbenes@...e.cz>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Joe Lawrence <joe.lawrence@...hat.com>,
        live-patching@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] livepatch: Use correct kobject cleanup function

On Tue, Apr 30, 2019 at 05:08:11PM +0200, Petr Mladek wrote:
> On Tue 2019-04-30 10:15:34, Tobin C. Harding wrote:
> > The correct cleanup function after a call to kobject_init_and_add() has
> > succeeded is kobject_del() _not_ kobject_put().  kobject_del() calls
> > kobject_put().
> 
> Really? I see only kobject_put(kobj->parent) in kobject_del.
> It decreases a reference of the _parent_ object and not
> the given one.

Thanks Petr, you are right.  I misread kobject_del().  The story
thickens, so we need to call kobject_del() AND kobject_put().

> Also the section "Kobject removal" in Documentation/kobject.txt
> says that kobject_del() is for two-stage removal. kobject_put()
> still needs to get called at a later time.

Is this call sequence above what is meant by 'two-stage removal', I
didn't really understand that bit of the docs (and I almost always just
assume docs are stale and take them as a hint only :)

> IMHO, this patch causes that kobject_put() would never get called.

I'll do a v2 of this one and re-check all the patches on this I've
already sent (including the docs ones).

> That said, we could probably make the removal a bit cleaner
> by using kobject_del() in klp_free_patch_start() and
> kobject_put() in klp_free_patch_finish(). But I have
> to think more about it.

Noted, thanks for your review.

	Tobin
	

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ