aboutsummaryrefslogtreecommitdiffstats
path: root/fs/isofs
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2013-07-25 05:49:11 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-09-26 20:18:28 -0400
commit4b5fe51a9a8e6d4c74a6f2717bf25e4132c551d3 (patch)
treeeac45eba4b1629528a78dd7daa0900ca330c87a8 /fs/isofs
parent1ca91545961a92067cb8ad3ebc1558c8d1574456 (diff)
isofs: Refuse RW mount of the filesystem instead of making it RO
commit 17b7f7cf58926844e1dd40f5eb5348d481deca6a upstream. Refuse RW mount of isofs filesystem. So far we just silently changed it to RO mount but when the media is writeable, block layer won't notice this change and thus will think device is used RW and will block eject button of the drive. That is unexpected by users because for non-writeable media eject button works just fine. Userspace mount(8) command handles this just fine and retries mounting with MS_RDONLY set so userspace shouldn't see any regression. Plus any tool mounting isofs is likely confronted with the case of read-only media where block layer already refuses to mount the filesystem without MS_RDONLY set so our behavior shouldn't be anything new for it. Reported-by: Hui Wang <hui.wang@canonical.com> Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/isofs')
-rw-r--r--fs/isofs/inode.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c
index d9b8aebdeb22..d3705490ff9c 100644
--- a/fs/isofs/inode.c
+++ b/fs/isofs/inode.c
@@ -125,8 +125,8 @@ static void destroy_inodecache(void)
125 125
126static int isofs_remount(struct super_block *sb, int *flags, char *data) 126static int isofs_remount(struct super_block *sb, int *flags, char *data)
127{ 127{
128 /* we probably want a lot more here */ 128 if (!(*flags & MS_RDONLY))
129 *flags |= MS_RDONLY; 129 return -EROFS;
130 return 0; 130 return 0;
131} 131}
132 132
@@ -779,15 +779,6 @@ root_found:
779 */ 779 */
780 s->s_maxbytes = 0x80000000000LL; 780 s->s_maxbytes = 0x80000000000LL;
781 781
782 /*
783 * The CDROM is read-only, has no nodes (devices) on it, and since
784 * all of the files appear to be owned by root, we really do not want
785 * to allow suid. (suid or devices will not show up unless we have
786 * Rock Ridge extensions)
787 */
788
789 s->s_flags |= MS_RDONLY /* | MS_NODEV | MS_NOSUID */;
790
791 /* Set this for reference. Its not currently used except on write 782 /* Set this for reference. Its not currently used except on write
792 which we don't have .. */ 783 which we don't have .. */
793 784
@@ -1546,6 +1537,9 @@ struct inode *isofs_iget(struct super_block *sb,
1546static struct dentry *isofs_mount(struct file_system_type *fs_type, 1537static struct dentry *isofs_mount(struct file_system_type *fs_type,
1547 int flags, const char *dev_name, void *data) 1538 int flags, const char *dev_name, void *data)
1548{ 1539{
1540 /* We don't support read-write mounts */
1541 if (!(flags & MS_RDONLY))
1542 return ERR_PTR(-EACCES);
1549 return mount_bdev(fs_type, flags, dev_name, data, isofs_fill_super); 1543 return mount_bdev(fs_type, flags, dev_name, data, isofs_fill_super);
1550} 1544}
1551 1545