The patch titled
     RAMFS NOMMU: missed POSIX UID/GID inode attribute checking
has been added to the -mm tree.  Its filename is
     ramfs-nommu-missed-posix-uid-gid-inode-attribute-checking.patch

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: RAMFS NOMMU: missed POSIX UID/GID inode attribute checking
From: Bryan Wu <[EMAIL PROTECTED]>

This bug was caught by LTP testcase fchmod06 on Blackfin platform.

In the manpage of fchmod, "EPERM: The effective UID does not match the
owner of the file, and the process is not privileged (Linux: it does not
have the CAP_FOWNER capability)."

But the ramfs nommu code missed the inode_change_ok POSIX UID/GID
verification.  This patch fixed this.

Signed-off-by: Bryan Wu <[EMAIL PROTECTED]>
Cc: David Howells <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 fs/ramfs/file-nommu.c |    5 +++++
 1 file changed, 5 insertions(+)

diff -puN 
fs/ramfs/file-nommu.c~ramfs-nommu-missed-posix-uid-gid-inode-attribute-checking 
fs/ramfs/file-nommu.c
--- 
a/fs/ramfs/file-nommu.c~ramfs-nommu-missed-posix-uid-gid-inode-attribute-checking
+++ a/fs/ramfs/file-nommu.c
@@ -195,6 +195,11 @@ static int ramfs_nommu_setattr(struct de
        unsigned int old_ia_valid = ia->ia_valid;
        int ret = 0;
 
+       /* POSIX UID/GID verification for setting inode attributes */
+       ret = inode_change_ok(inode, ia);
+       if (ret)
+               return ret;
+
        /* by providing our own setattr() method, we skip this quotaism */
        if ((old_ia_valid & ATTR_UID && ia->ia_uid != inode->i_uid) ||
            (old_ia_valid & ATTR_GID && ia->ia_gid != inode->i_gid))
_

Patches currently in -mm which might be from [EMAIL PROTECTED] are

origin.patch
ramfs-nommu-missed-posix-uid-gid-inode-attribute-checking.patch
lots-of-architectures-enable-arbitary-speed-tty-support.patch
blackfin-on-chip-ethernet-mac-controller-driver.patch
blackfin-enable-arbitary-speed-serial-setting.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to