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] [day] [month] [year] [list]
Message-ID: <87bnitz11v.fsf@openvz.org>
Date:	Sun, 12 Apr 2015 20:52:44 +0300
From:	Dmitry Monakhov <dmonakhov@...nvz.org>
To:	Al Viro <viro@...IV.linux.org.uk>
Cc:	linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH 1/2] pipe: fix race with fcntl

Al Viro <viro@...IV.linux.org.uk> writes:

> On Sun, Apr 12, 2015 at 09:08:21PM +0400, Dmitry Monakhov wrote:
>> Fix other long standing issues caused by fcntl(,F_SETFL,):
>> - User can disable O_DIRECT for pipe[1] (paketized IO), but can not enable it again.
>> - Currently we do not set O_APPEND on pipe[1] (IMHO it is wrong, but let it be)
>>   so it is reasonable to completely prohibit change O_APPEND flag on both
>>   end's of pipe. Add ->check_flags method in order to diallow O_APPEND toggling.
>> 
>> Signed-off-by: Dmitry Monakhov <dmonakhov@...nvz.org>
>> ---
>
> TBH, all those ->direct_IO != NULL checks seem to be a wrong approach.
> If nothing else, it forces several filesystem into inventing a fake
> ->direct_IO just to fool those tests.  How about we
> 	* introduce FMODE_MAY_DIRECT and allow ->open() explicitly set it
> 	* make open_check_o_direct() and fcntl.c check that instead of poking
> in ->f_mapping->a_ops, etc.
> 	* provide a variant of generic_file_open() that would set that
> bit and use it on the filesystems that handle dio
100% agree. FMODE is perfect place for that.

BTW: I always wondering: why we do not mark pipe[1]->f_flags with O_APPEND?
Probably the answer is that nobody care about ->f_flags since no_llseek
returns -ESPIPE, but f_flags are visiable via fcntl so IMHO it is
reasonable to fix that too.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Download attachment "signature.asc" of type "application/pgp-signature" (473 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ