[<prev] [next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.1105082028310.7013@artax.karlin.mff.cuni.cz>
Date: Sun, 8 May 2011 20:44:00 +0200 (CEST)
From: Mikulas Patocka <mikulas@...ax.karlin.mff.cuni.cz>
To: Linus Torvalds <torvalds@...ux-foundation.org>
cc: linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org
Subject: [PATCH 8/14] 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@...ax.karlin.mff.cuni.cz>
---
fs/hpfs/inode.c | 4 ++++
1 file changed, 4 insertions(+)
Index: linux-2.6.39-rc5-fast/fs/hpfs/inode.c
===================================================================
--- linux-2.6.39-rc5-fast.orig/fs/hpfs/inode.c 2011-05-05 01:02:49.000000000 +0200
+++ linux-2.6.39-rc5-fast/fs/hpfs/inode.c 2011-05-05 01:02:53.000000000 +0200
@@ -261,6 +261,10 @@ int hpfs_setattr(struct dentry *dentry,
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;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists