Commit 48f10e8c authored by Mikulas Patocka's avatar Mikulas Patocka Committed by Linus Torvalds

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: default avatarMikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent f7397681
...@@ -261,6 +261,10 @@ int hpfs_setattr(struct dentry *dentry, struct iattr *attr) ...@@ -261,6 +261,10 @@ int hpfs_setattr(struct dentry *dentry, struct iattr *attr)
hpfs_lock(inode->i_sb); hpfs_lock(inode->i_sb);
if (inode->i_ino == hpfs_sb(inode->i_sb)->sb_root) if (inode->i_ino == hpfs_sb(inode->i_sb)->sb_root)
goto out_unlock; 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) if ((attr->ia_valid & ATTR_SIZE) && attr->ia_size > inode->i_size)
goto out_unlock; goto out_unlock;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment