Patchwork [2/2,maverick,CVE,2/2] Change check_ruid flag to a more reasonable type

login
register
mail settings
Submitter John Johansen
Date Aug. 11, 2011, 7:48 a.m.
Message ID <1313048881-23568-2-git-send-email-john.johansen@canonical.com>
Download mbox | patch
Permalink /patch/109565/
State New
Headers show

Comments

John Johansen - Aug. 11, 2011, 7:48 a.m.
The first interation of the patch for the check ruid flag at mount time
flag returned a full uid.  However the revised patch used the check_ruid
parameter solely as a boolean flag, but missed fixing the parameters type.

Change the parameter type to int instead of uid_t.

CVE-2011-1833
BugLink: http://bugs.launchpad.net/bugs/732628

Signed-off-by: John Johansen <john.johansen@canonical.com>
---
 fs/ecryptfs/main.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

Patch

diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c
index 2be138a..8ba3965 100644
--- a/fs/ecryptfs/main.c
+++ b/fs/ecryptfs/main.c
@@ -285,7 +285,7 @@  static void ecryptfs_init_mount_crypt_stat(
  * Returns zero on success; non-zero on error
  */
 static int ecryptfs_parse_options(struct ecryptfs_sb_info *sbi, char *options,
-				  uid_t *check_ruid)
+				  int *check_ruid)
 {
 	char *p;
 	int rc = 0;
@@ -506,8 +506,7 @@  static struct file_system_type ecryptfs_fs_type;
 static int ecryptfs_read_super(struct super_block *sb, const char *dev_name)
 {
 	struct path path;
-	uid_t check_ruid;
-	int rc;
+	int rc, check_ruid;
 
 	rc = kern_path(dev_name, LOOKUP_FOLLOW | LOOKUP_DIRECTORY, &path);
 	if (rc) {