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:	Thu, 9 Oct 2014 14:50:34 -0600
From:	Andreas Dilger <adilger@...ger.ca>
To:	Dmitry Monakhov <dmonakhov@...nvz.org>
Cc:	linux-ext4@...r.kernel.org, sasha.levin@...cle.com
Subject: Re: [PATCH] ext4: fix race between write and fcntl(F_SETFL)

On Oct 9, 2014, at 5:14 AM, Dmitry Monakhov <dmonakhov@...nvz.org> wrote:
> O_DIRECT flags can be toggeled via fcntl(F_SETFL).
> But this value checked twice inside ext4_file_write_iter() and __generic_file_write()
> which result in BUG_ON (see typical stack trace below)
> In order to fix this we have to use our own copy of __generic_file_write
> and pass o_direct status explicitly.

This seems like a generic problem that would be better served by fixing
the core code instead of making a private copy of such a large function
for ext4.  I expect other filesystems might have similar issues if the
O_DIRECT state is changed in the middle of IO?

One option is to flush pending IO on the file if the O_DIRECT flag is
changed in setfl(). This is a bit heavyweight but I can't imagine any
sane app that is changing the O_DIRECT state on a file repeatedly.

Cheers, Andreas






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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ