Artem Bityutskiy 78530bf7f2 UBIFS: fix oops when R/O file-system is fsync'ed
This patch fixes severe UBIFS bug: UBIFS oopses when we 'fsync()' an
file on R/O-mounter file-system. We (the UBIFS authors) incorrectly
thought that VFS would not propagate 'fsync()' down to the file-system
if it is read-only, but this is not the case.

It is easy to exploit this bug using the following simple perl script:

use strict;
use File::Sync qw(fsync sync);

die "File path is not specified" if not defined $ARGV[0];
my $path = $ARGV[0];

open FILE, "<", "$path" or die "Cannot open $path: $!";
fsync(\*FILE) or die "cannot fsync $path: $!";
close FILE or die "Cannot close $path: $!";

Thanks to Reuben Dowle <Reuben.Dowle@navico.com> for reporting about this
issue.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Reported-by: Reuben Dowle <Reuben.Dowle@navico.com>
Cc: stable@kernel.org
2011-04-13 10:43:32 +03:00
..
2011-03-31 11:26:23 -03:00
2008-12-31 14:13:24 +02:00
2011-03-16 14:05:25 +02:00
2009-03-08 13:29:09 +02:00
2010-09-19 21:07:58 +03:00
2011-04-05 10:45:45 +03:00
2010-09-19 21:07:58 +03:00
2011-03-24 16:14:26 +02:00
2011-03-24 16:14:26 +02:00
2008-07-15 17:35:24 +03:00
2011-03-24 16:14:26 +02:00
2010-09-19 21:07:58 +03:00
2011-02-06 15:08:02 +02:00
2011-04-05 10:45:09 +03:00
2008-09-30 11:12:57 +03:00
2011-01-17 23:24:30 +02:00
2011-04-05 23:51:48 +02:00