Skip to content

Commit

Permalink
HPFS: Restrict uid and gid to 16-bit values
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mikulas Patocka authored and torvalds committed May 9, 2011
1 parent f739768 commit 48f10e8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fs/hpfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 48f10e8

Please sign in to comment.