summaryrefslogtreecommitdiff
path: root/fs/hpfs
diff options
context:
space:
mode:
authorMikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>2011-05-08 22:44:00 +0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-05-09 20:04:24 +0400
commit48f10e8ce7461b393186c4c7c6d6f6634082159c (patch)
tree3365f32b68e207b4961452eff2030c811950811f /fs/hpfs
parentf73976818adeaa46515a238b21e865850b011a87 (diff)
downloadlinux-48f10e8ce7461b393186c4c7c6d6f6634082159c.tar.xz
HPFS: Restrict uid and gid to 16-bit values
Restrict uid and gid to 16-bit values. HPFS stores only 2 bytes in the EAs. Signed-off-by: Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/hpfs')
-rw-r--r--fs/hpfs/inode.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/hpfs/inode.c b/fs/hpfs/inode.c
index d093ce749412..bc61bb4fd38d 100644
--- a/fs/hpfs/inode.c
+++ b/fs/hpfs/inode.c
@@ -261,6 +261,10 @@ int hpfs_setattr(struct dentry *dentry, struct iattr *attr)
hpfs_lock(inode->i_sb);
if (inode->i_ino == hpfs_sb(inode->i_sb)->sb_root)
goto out_unlock;
+ if ((attr->ia_valid & ATTR_UID) && attr->ia_uid >= 0x10000)
+ goto out_unlock;
+ if ((attr->ia_valid & ATTR_GID) && attr->ia_gid >= 0x10000)
+ goto out_unlock;
if ((attr->ia_valid & ATTR_SIZE) && attr->ia_size > inode->i_size)
goto out_unlock;