linux/fs/udf
Eric Sandeen 39b3f6d6e9 [PATCH] mount udf UDF_PART_FLAG_READ_ONLY partitions with MS_RDONLY
There's a bug where a UDF_PART_FLAG_READ_ONLY udf partition gets mounted
read-write, then subsequent problems happen; files seem to be able to be
removed, but file creation results in EIO or worse, oops.

EIO is coming from udf_new_block(), which returns EIO if the right flags
aren't set; only UDF_PART_FLAG_READ_ONLY is set in this case.  We probably
s hould not have gotten this far...

Attached patch seems to fix it - and includes a printk to alert the user
that their "rw" mount request has been converted to "ro."

Here's the testcase I used:

[root@magnesium ~]# mkisofs -R -J -udf -o testiso /tmp/
...
Total translation table size: 0
Total rockridge attributes bytes: 342923
Total directory bytes: 382312
Path table size(bytes): 104
Max brk space used 103000
105059 extents written (205 MB)

[root@magnesium ~]# mount -o loop testiso /mnt/test/
[root@magnesium ~]# ls /mnt/test/fsfile
/mnt/test/fsfile
[root@magnesium ~]# rm /mnt/test/fsfile
[root@magnesium ~]# ls /mnt/test/fsfile
ls: /mnt/test/fsfile: No such file or directory
[root@magnesium ~]# touch /mnt/test/fsfile
touch: cannot touch `/mnt/test/fsfile': Input/output error
[root@magnesium tmp]# grep udf /proc/mounts
/dev/loop1 /mnt/test udf rw 0 0

Force readonly mounts of UDF partitions marked as read-only.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-29 09:18:09 -07:00
..
Makefile Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
balloc.c [PATCH] sem2mutex: UDF 2006-03-23 07:38:14 -08:00
crc.c remove pointers to the defunct UDF mailing list 2006-01-03 13:19:13 +01:00
dir.c [PATCH] Make most file operations structs in fs/ const 2006-03-28 09:16:06 -08:00
directory.c remove pointers to the defunct UDF mailing list 2006-01-03 13:19:13 +01:00
ecma_167.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
file.c [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
fsync.c remove pointers to the defunct UDF mailing list 2006-01-03 13:19:13 +01:00
ialloc.c [PATCH] inode-diet: Eliminate i_blksize from the inode structure 2006-09-27 08:26:18 -07:00
inode.c [PATCH] inode-diet: Eliminate i_blksize from the inode structure 2006-09-27 08:26:18 -07:00
lowlevel.c remove pointers to the defunct UDF mailing list 2006-01-03 13:19:13 +01:00
misc.c remove pointers to the defunct UDF mailing list 2006-01-03 13:19:13 +01:00
namei.c [PATCH] UDF: Fix issues reported by Coverity in namei.c 2006-02-03 08:32:11 -08:00
osta_udf.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
partition.c remove pointers to the defunct UDF mailing list 2006-01-03 13:19:13 +01:00
super.c [PATCH] mount udf UDF_PART_FLAG_READ_ONLY partitions with MS_RDONLY 2006-09-29 09:18:09 -07:00
symlink.c [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
truncate.c Fix possible UDF deadlock and memory corruption (CVE-2006-4145) 2006-08-22 12:52:23 -07:00
udf_i.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
udf_sb.h [PATCH] udf: fix uid/gid options and add uid/gid=ignore and forget options 2006-03-08 14:14:00 -08:00
udfdecl.h Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
udfend.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
udftime.c [PATCH] UDF filesystem: array '__mon_yday' declared as not static 2005-05-31 14:54:18 -07:00
unicode.c remove pointers to the defunct UDF mailing list 2006-01-03 13:19:13 +01:00