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  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, 7 Sep 2022 08:52:11 -0400
From: (J. Bruce Fields)
To:     Jeff Layton <>
Cc:     NeilBrown <>,,,,,,,,,,,,,,,,,,,,,,
Subject: Re: [man-pages RFC PATCH v4] statx, inode: document the new

On Wed, Sep 07, 2022 at 08:47:20AM -0400, Jeff Layton wrote:
> On Wed, 2022-09-07 at 21:37 +1000, NeilBrown wrote:
> > On Wed, 07 Sep 2022, Jeff Layton wrote:
> > > +The change to \fIstatx.stx_ino_version\fP is not atomic with respect to the
> > > +other changes in the inode. On a write, for instance, the i_version it usually
> > > +incremented before the data is copied into the pagecache. Therefore it is
> > > +possible to see a new i_version value while a read still shows the old data.
> > 
> > Doesn't that make the value useless?
> > 
> No, I don't think so. It's only really useful for comparing to an older
> sample anyway. If you do "statx; read; statx" and the value hasn't
> changed, then you know that things are stable. 

I don't see how that helps.  It's still possible to get:

		reader		writer
		------		------
				update page cache



> > Surely the change number must
> > change no sooner than the change itself is visible, otherwise stale data
> > could be cached indefinitely.
> > 
> > If currently implementations behave this way, surely they are broken.
> It's certainly not ideal but we've never been able to offer truly atomic
> behavior here given that Linux is a general-purpose OS. The behavior is
> a little inconsistent too:
> The c/mtime update and i_version bump on directories (mostly) occur
> after the operation. c/mtime updates for files however are mostly driven
> by calls to file_update_time, which happens before data is copied to the
> pagecache.
> It's not clear to me why it's done this way. Maybe to ensure that the
> metadata is up to date in the event that a statx comes in? Improving
> this would be nice, but I don't see a way to do that without regressing
> performance.
> -- 
> Jeff Layton <>

Powered by blists - more mailing lists