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] [day] [month] [year] [list]
Date:	Fri, 10 Oct 2008 13:25:15 +1100
From:	Nick Piggin <nickpiggin@...oo.com.au>
To:	dcg <diegocalleja@...il.com>
Cc:	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Hisashi Hifumi <hifumi.hisashi@....ntt.co.jp>,
	torvalds@...ux-foundation.org,
	Andrew Morton <akpm@...ux-foundation.org>,
	Andi Kleen <andi@...stfloor.org>, linux-kernel@...r.kernel.org,
	linux-fsdevel@...r.kernel.org,
	"Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>,
	Theodore Ts'o <tytso@....edu>
Subject: Re: [RESEND] [PATCH] VFS: make file->f_pos access atomic on 32bit arch

On Friday 10 October 2008 08:51, dcg wrote:
> El Wed, 08 Oct 2008 08:51:51 +0200, Peter Zijlstra <a.p.zijlstra@...llo.nl> 
escribió:
> > either dup() the fd or open() the file twice. There is absolutely no
> > valid reason to have two threads read from the same fd without
> > synchronising their access to it - never.
>
> In case this is the final consensus, I think that a topic that is brought
> to the list every few months and even generates (aparently not neccesary)
> patches is a hint that there should be somewhere a commentary (*) like
> this:
>
> (*) I don't know if what I wrote is 100% correct.
>
>
> Signed-off-by: Diego Calleja García <diegocg@...il.com>
>
> Index: 2.6/include/linux/fs.h
> ===================================================================
> --- 2.6.orig/include/linux/fs.h	2008-10-09 00:06:50.000000000 +0200
> +++ 2.6/include/linux/fs.h	2008-10-09 00:29:03.000000000 +0200
> @@ -821,6 +821,18 @@
>  	atomic_long_t		f_count;
>  	unsigned int 		f_flags;
>  	mode_t			f_mode;
> +	/*
> +	 * Linux does NOT guarantee atomic reading/writing to file->f_pos in
> +	 * multithread apps running in 32 bit machines. There're several
> +	 * reasons for this behaviour:

Note that I don't think we'd want to explicitly guarantee that it is atomic
on 64-bit machines either. It does happen to be, but I don't think we want
anybody to rely on that...
--
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