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:	Mon, 3 Mar 2014 21:26:42 +0000
From:	Al Viro <viro@...IV.linux.org.uk>
To:	George Spelvin <linux@...izon.com>
Cc:	torvalds@...ux-foundation.org, linux-fsdevel@...r.kernel.org,
	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 04:03:59PM -0500, George Spelvin wrote:
> >  struct fd {
> >  	struct file *file;
> > -	int need_put;
> > +	unsigned need_put:1, need_pos_unlock:1;
> >  };
> 
> Since we're rounding up to 2*sizeof(struct file *) anyway, is this a case
> where wasting space on a couple of char (or bool) flags would generate
> better code than a bitfield?
> 
> In particular, the code to set need_pos_unlock (which will be executed
> each read/write for most files) is messy in the bitfield case.
> A byte store is much cleaner.
> 
> (If you want to use bits, why not use the two lsbits of the file pointer
> for the purpose?  That would save a lot of space.)

Most of the cases have it kept separately in registers, actually - there's
a reason why fdget() and friends are inlined.
--
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