]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/ecryptfs/inode.c
cfq_get_queue: fix possible NULL pointer access
[linux-2.6-omap-h63xx.git] / fs / ecryptfs / inode.c
index 5701f816faf47e30975b4d2a46baeb6d21c05a38..0b1ab016fa2e513589c004373323c376af1de9ba 100644 (file)
@@ -914,6 +914,14 @@ static int ecryptfs_setattr(struct dentry *dentry, struct iattr *ia)
                if (rc < 0)
                        goto out;
        }
+
+       /*
+        * mode change is for clearing setuid/setgid bits. Allow lower fs
+        * to interpret this in its own way.
+        */
+       if (ia->ia_valid & (ATTR_KILL_SUID | ATTR_KILL_SGID))
+               ia->ia_valid &= ~ATTR_MODE;
+
        rc = notify_change(lower_dentry, ia);
 out:
        fsstack_copy_attr_all(inode, lower_inode, NULL);