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:	Mon, 3 Mar 2014 23:28:58 +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 Mon, Mar 03, 2014 at 02:17:55PM -0800, Linus Torvalds wrote:

> Something like the attached untested patch. This gets rid of
> "fget_light()", and instead makes "fdget()" the native interface (same
> for the "raw" version).

Umm...   I would be very surprised if that worked well.  You have just
forced fdget() to comply to the ABI.  And unless that has such structs
returned in register pairs, there's no way for compiler to do about
that.

The current variant lets the optimizer see what's going on and decide
that since it doesn't need struct fd local variable kept as a single
object, so it can turn it into a pair of locals, independently assigned
(in the inlined fdget() body) and independently used.  If those can
be put into registers, it happens separately for both, etc.

Try your variant on e.g. ppc or alpha.  Both will pass that struct on
stack.  So will mips.  So will s390.  So will 32bit sparc, not that there
had been much use of sparc32 kernels...

It will work on amd64, sparc64.  On i386 we explicitly pass it
-freg-struct-return, so it passes in a pair of registers there as well.

We could start usinmg -freg-struct-return on other architectures, but
I'm not sure if it would actually work - e.g. on ppc it still returns
such a struct on stack.
--
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