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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200225204632.GA6191@infradead.org>
Date:   Tue, 25 Feb 2020 12:46:32 -0800
From:   Christoph Hellwig <hch@...radead.org>
To:     "Darrick J. Wong" <darrick.wong@...cle.com>
Cc:     Qian Cai <cai@....pw>, elver@...gle.com, linux-xfs@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] xfs: fix data races in inode->i_*time

On Tue, Feb 25, 2020 at 12:28:29PM -0800, Darrick J. Wong wrote:
> > diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c
> > index 81f2f93caec0..2d5ca13ee9da 100644
> > --- a/fs/xfs/xfs_iops.c
> > +++ b/fs/xfs/xfs_iops.c
> > @@ -547,9 +547,9 @@
> >  	stat->uid = inode->i_uid;
> >  	stat->gid = inode->i_gid;
> >  	stat->ino = ip->i_ino;
> > -	stat->atime = inode->i_atime;
> > -	stat->mtime = inode->i_mtime;
> > -	stat->ctime = inode->i_ctime;
> > +	stat->atime = READ_ONCE(inode->i_atime);
> > +	stat->mtime = READ_ONCE(inode->i_mtime);
> > +	stat->ctime = READ_ONCE(inode->i_ctime);
> 
> Seeing as one is supposed to take ILOCK_SHARED before reading inode core
> information, why don't we do that here?  Is there some huge performance
> benefit to be realized from READ_ONCE vs. waiting for the lock that
> protects all the writes from each other?

Yes, I don't see how READ_ONCE works on a structure.

I think you should look into fixing this race in generic_fillattr
first, and we then piggy back on that fix in XFS once it has all been
sorted out.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ