Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=85f6038f2170e3335dda09c3dfb0f83110e87019
Commit:     85f6038f2170e3335dda09c3dfb0f83110e87019
Parent:     c8d8170feb824875baf68f8aaecb181a6500ce81
Author:     Bryan Wu <[EMAIL PROTECTED]>
AuthorDate: Tue Jun 5 11:02:01 2007 +0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Thu Jun 7 17:11:13 2007 -0700

    RAMFS NOMMU: missed POSIX UID/GID inode attribute checking
    
    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: Linus Torvalds <[EMAIL PROTECTED]>
---
 fs/ramfs/file-nommu.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/fs/ramfs/file-nommu.c b/fs/ramfs/file-nommu.c
index 9345a46..5d258c4 100644
--- a/fs/ramfs/file-nommu.c
+++ b/fs/ramfs/file-nommu.c
@@ -195,6 +195,11 @@ static int ramfs_nommu_setattr(struct dentry *dentry, 
struct iattr *ia)
        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))
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to