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, 17 Dec 2008 13:08:26 -0600
From:	"Serge E. Hallyn" <serue@...ibm.com>
To:	Dave Hansen <dave@...ux.vnet.ibm.com>
Cc:	lkml <linux-kernel@...r.kernel.org>,
	Linux Containers <containers@...ts.osdl.org>
Subject: Re: [PATCH 2/2] ipc namespaces: implement support for posix
	msqueues

Quoting Dave Hansen (dave@...ux.vnet.ibm.com):
> On Wed, 2008-12-17 at 11:55 -0600, Serge E. Hallyn wrote:
> > -void free_ipc_ns(struct kref *kref)
> > +void put_ipc_ns(struct ipc_namespace *ns)
> >  {
> > -       struct ipc_namespace *ns;
> > +       if (ns && atomic_dec_and_lock(&ns->count, &mq_lock)) {
> > +               mq_clear_sbinfo(ns);
> > +               spin_unlock(&mq_lock);
> > +               mq_put_mnt(ns);
> > +               free_ipc_ns(ns);
> > +       }
> > +}
> 
> OK, I see now why you wanted to remove the kref and add an atomic_t.
> That's probably worth a sentence in the patch description.

Good point, will do.

> I know that atomic_dec_and_lock() can be a nice logical thing to do, but
> is it necessary here?  Basically, is there something that happens under
> mq_lock that can re-raise the ns->count?

A racing task from another ipc namespace can open a mq file through
the VFS and thereby bump the ipc's refcount.  Will comment that here and
in the patch description.

thanks,
-serge
--
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