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, 13 Nov 2012 21:01:59 +0400
From:	Cyrill Gorcunov <gorcunov@...nvz.org>
To:	Oleg Nesterov <oleg@...hat.com>
Cc:	Pavel Emelyanov <xemul@...allels.com>,
	Al Viro <viro@...IV.linux.org.uk>,
	Alexey Dobriyan <adobriyan@...il.com>,
	James Bottomley <jbottomley@...allels.com>,
	"Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>,
	Matthew Helsley <matt.helsley@...il.com>,
	"J. Bruce Fields" <bfields@...ldses.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org
Subject: Re: + fs-epoll-add-procfs-fdinfo-helper.patch added to -mm tree

On Tue, Nov 13, 2012 at 05:49:51PM +0100, Oleg Nesterov wrote:
> On 11/13, Cyrill Gorcunov wrote:
> >
> >  struct signalfd_ctx {
> > +	rwlock_t lock;
> >  	sigset_t sigmask;
> 
> Oh, I don't think.
> 
> rwlock_t is horrible in general, and what it can buy for signalfd?
> A plain spinlock would be better. Or seqlock_t.
> 
> Whatever you do, you are trying to introduce the lock which should
> serialize the access to ->sigmask correctly. In this case I think
> you should split this change into 2 patches. The first one should
> fix the locking, imo. sys_signalfd4() should not use ->siglock at
> all, and the users which take ->siglock to read ->sigmask should be
> updated.

I see

> 
> Or,
> 
> > +#ifdef CONFIG_PROC_FS
> > +static int signalfd_show_fdinfo(struct seq_file *m, struct file *f)
> > +{
> > +	struct signalfd_ctx *ctx = f->private_data;
> > +	sigset_t sigmask;
> > +
> > +	read_lock(&ctx->lock);
> > +	sigmask = ctx->sigmask;
> > +	read_unlock(&ctx->lock);
> 
> Just read ctx->sigmask lockless. Do we really care if show_fdinfo()
> reads the value "in between" ?

As from c/r patch I think we can read it lockless (since we do stop
tasks anyway before doing checkpoint). So I would prefer to provide
it without locks at all.
--
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