linux/fs/ubifs
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
..
Kconfig UBIFS: do not select KALLSYMS_ALL 2011-04-05 10:45:45 +03:00
Makefile
budget.c Fix common misspellings 2011-03-31 11:26:23 -03:00
commit.c UBIFS: do not read flash unnecessarily 2011-04-05 10:39:40 +03:00
compress.c
debug.c UBIFS: fix debugging failure in dbg_check_space_info 2011-04-05 11:07:37 +03:00
debug.h UBIFS: clean-up commentaries 2011-03-16 14:05:25 +02:00
dir.c fs: Remove i_nlink check from file system link callback 2011-03-15 02:21:44 -04:00
file.c UBIFS: fix oops when R/O file-system is fsync'ed 2011-04-13 10:43:32 +03:00
find.c
gc.c UBIFS: introduce new flags for RO mounts 2010-09-19 21:07:58 +03:00
io.c UBIFS: use max_write_size for write-buffers 2011-03-08 10:12:49 +02:00
ioctl.c userns: rename is_owner_or_cap to inode_owner_or_capable 2011-03-23 19:47:13 -07:00
journal.c UBIFS: handle allocation failures in UBIFS write path 2011-03-11 10:52:07 +02:00
key.h UBIFS: mark unused key objects as invalid 2010-08-30 10:19:08 +03:00
log.c UBIFS: introduce new flags for RO mounts 2010-09-19 21:07:58 +03:00
lprops.c UBIFS: use GFP_NOFS properly 2011-03-24 16:14:26 +02:00
lpt.c UBIFS: fix oops on error path in read_pnode 2011-04-05 10:40:31 +03:00
lpt_commit.c UBIFS: use GFP_NOFS properly 2011-03-24 16:14:26 +02:00
master.c UBIFS: introduce new flags for RO mounts 2010-09-19 21:07:58 +03:00
misc.h UBIFS: introduce new flags for RO mounts 2010-09-19 21:07:58 +03:00
orphan.c UBIFS: use GFP_NOFS properly 2011-03-24 16:14:26 +02:00
recovery.c UBIFS: use max_write_size during recovery 2011-03-08 10:12:49 +02:00
replay.c UBIFS: do not allocate unneeded scan buffer 2010-10-21 11:15:19 +03:00
sb.c UBIFS: introduce new flags for RO mounts 2010-09-19 21:07:58 +03:00
scan.c UBIFS: remove double semicolon 2011-02-06 15:08:02 +02:00
shrinker.c UBIFS: introduce new flags for RO mounts 2010-09-19 21:07:58 +03:00
super.c UBIFS: fix assertion warnings 2011-04-05 10:45:09 +03:00
tnc.c UBIFS: introduce mounting flag 2011-01-17 23:24:30 +02:00
tnc_commit.c
tnc_misc.c
ubifs-media.h
ubifs.h UBIFS: handle allocation failures in UBIFS write path 2011-03-11 10:52:07 +02:00
xattr.c fs: export empty_aops 2011-04-05 23:51:48 +02:00