diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ext2/ioctl.c | 5 | ||||
-rw-r--r-- | fs/ext3/ioctl.c | 5 | ||||
-rw-r--r-- | fs/ext4/ioctl.c | 5 | ||||
-rw-r--r-- | fs/jfs/ioctl.c | 3 | ||||
-rw-r--r-- | fs/reiserfs/ioctl.c | 3 |
5 files changed, 21 insertions, 0 deletions
diff --git a/fs/ext2/ioctl.c b/fs/ext2/ioctl.c index c2324d5fe4ac..320b2cb3d4d2 100644 --- a/fs/ext2/ioctl.c +++ b/fs/ext2/ioctl.c | |||
@@ -47,6 +47,11 @@ int ext2_ioctl (struct inode * inode, struct file * filp, unsigned int cmd, | |||
47 | flags &= ~EXT2_DIRSYNC_FL; | 47 | flags &= ~EXT2_DIRSYNC_FL; |
48 | 48 | ||
49 | mutex_lock(&inode->i_mutex); | 49 | mutex_lock(&inode->i_mutex); |
50 | /* Is it quota file? Do not allow user to mess with it */ | ||
51 | if (IS_NOQUOTA(inode)) { | ||
52 | mutex_unlock(&inode->i_mutex); | ||
53 | return -EPERM; | ||
54 | } | ||
50 | oldflags = ei->i_flags; | 55 | oldflags = ei->i_flags; |
51 | 56 | ||
52 | /* | 57 | /* |
diff --git a/fs/ext3/ioctl.c b/fs/ext3/ioctl.c index 4a2a02c95bf9..023a070f55f1 100644 --- a/fs/ext3/ioctl.c +++ b/fs/ext3/ioctl.c | |||
@@ -51,6 +51,11 @@ int ext3_ioctl (struct inode * inode, struct file * filp, unsigned int cmd, | |||
51 | flags &= ~EXT3_DIRSYNC_FL; | 51 | flags &= ~EXT3_DIRSYNC_FL; |
52 | 52 | ||
53 | mutex_lock(&inode->i_mutex); | 53 | mutex_lock(&inode->i_mutex); |
54 | /* Is it quota file? Do not allow user to mess with it */ | ||
55 | if (IS_NOQUOTA(inode)) { | ||
56 | mutex_unlock(&inode->i_mutex); | ||
57 | return -EPERM; | ||
58 | } | ||
54 | oldflags = ei->i_flags; | 59 | oldflags = ei->i_flags; |
55 | 60 | ||
56 | /* The JOURNAL_DATA flag is modifiable only by root */ | 61 | /* The JOURNAL_DATA flag is modifiable only by root */ |
diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c index c04c7ccba9e3..e7f894bdb420 100644 --- a/fs/ext4/ioctl.c +++ b/fs/ext4/ioctl.c | |||
@@ -51,6 +51,11 @@ int ext4_ioctl (struct inode * inode, struct file * filp, unsigned int cmd, | |||
51 | flags &= ~EXT4_DIRSYNC_FL; | 51 | flags &= ~EXT4_DIRSYNC_FL; |
52 | 52 | ||
53 | mutex_lock(&inode->i_mutex); | 53 | mutex_lock(&inode->i_mutex); |
54 | /* Is it quota file? Do not allow user to mess with it */ | ||
55 | if (IS_NOQUOTA(inode)) { | ||
56 | mutex_unlock(&inode->i_mutex); | ||
57 | return -EPERM; | ||
58 | } | ||
54 | oldflags = ei->i_flags; | 59 | oldflags = ei->i_flags; |
55 | 60 | ||
56 | /* The JOURNAL_DATA flag is modifiable only by root */ | 61 | /* The JOURNAL_DATA flag is modifiable only by root */ |
diff --git a/fs/jfs/ioctl.c b/fs/jfs/ioctl.c index 3c8663bea98c..dfda12a073e1 100644 --- a/fs/jfs/ioctl.c +++ b/fs/jfs/ioctl.c | |||
@@ -79,6 +79,9 @@ int jfs_ioctl(struct inode * inode, struct file * filp, unsigned int cmd, | |||
79 | if (!S_ISDIR(inode->i_mode)) | 79 | if (!S_ISDIR(inode->i_mode)) |
80 | flags &= ~JFS_DIRSYNC_FL; | 80 | flags &= ~JFS_DIRSYNC_FL; |
81 | 81 | ||
82 | /* Is it quota file? Do not allow user to mess with it */ | ||
83 | if (IS_NOQUOTA(inode)) | ||
84 | return -EPERM; | ||
82 | jfs_get_inode_flags(jfs_inode); | 85 | jfs_get_inode_flags(jfs_inode); |
83 | oldflags = jfs_inode->mode2; | 86 | oldflags = jfs_inode->mode2; |
84 | 87 | ||
diff --git a/fs/reiserfs/ioctl.c b/fs/reiserfs/ioctl.c index c438a8f83f26..e0f0f098a523 100644 --- a/fs/reiserfs/ioctl.c +++ b/fs/reiserfs/ioctl.c | |||
@@ -57,6 +57,9 @@ int reiserfs_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, | |||
57 | if (get_user(flags, (int __user *)arg)) | 57 | if (get_user(flags, (int __user *)arg)) |
58 | return -EFAULT; | 58 | return -EFAULT; |
59 | 59 | ||
60 | /* Is it quota file? Do not allow user to mess with it. */ | ||
61 | if (IS_NOQUOTA(inode)) | ||
62 | return -EPERM; | ||
60 | if (((flags ^ REISERFS_I(inode)-> | 63 | if (((flags ^ REISERFS_I(inode)-> |
61 | i_attrs) & (REISERFS_IMMUTABLE_FL | | 64 | i_attrs) & (REISERFS_IMMUTABLE_FL | |
62 | REISERFS_APPEND_FL)) | 65 | REISERFS_APPEND_FL)) |