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] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 4 Mar 2014 20:00:27 +0000
From:	Al Viro <viro@...IV.linux.org.uk>
To:	Linus Torvalds <torvalds@...ux-foundation.org>
Cc:	George Spelvin <linux@...izon.com>,
	linux-fsdevel <linux-fsdevel@...r.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: Update of file offset on write() etc. is non-atomic with I/O

On Tue, Mar 04, 2014 at 01:05:17AM +0000, Al Viro wrote:

> It's probably not worth replacing struct fd with typedef to unsigned long -
> too easy to have it confused with a file descriptor itself and pass to
> something that expects e.g. int.  In any case, since we leave fdget()
> inlined, compiler will see the unsigned long it's been initialized with,
> so if it decides that it's cheaper to replace f.file with v & ~3 through
> the whole thing, keep v around and discard local struct fd completely,
> it'll be able to do so just fine...
> 
> I'll play around with cross-builds a bit and see what falls out of all
> that.

OK, with the attached set (the first one is essentially unchanged from
your first one), it seems to work and produce better code on all targets
I've tried.  Comments?

I've also pushed those (on top of old ocfs2 fix) into vfs.git#for-linus,
if you prefer to read it that way.  Should propagate in a few...

View attachment "0001-vfs-atomic-f_pos-accesses-as-per-POSIX.patch" of type "text/plain" (8698 bytes)

View attachment "0002-sockfd_lookup_light-switch-to-fdget-W-Waway-from-fge.patch" of type "text/plain" (1022 bytes)

View attachment "0003-get-rid-of-fget_light.patch" of type "text/plain" (5191 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ