From: Jeff Layton Date: Thu, 18 Oct 2007 10:05:17 +0000 (-0700) Subject: ecryptfs: allow lower fs to interpret ATTR_KILL_S*ID X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1ac564ecabc777636cf4eb88840802d7dc57d286;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git ecryptfs: allow lower fs to interpret ATTR_KILL_S*ID Make sure ecryptfs doesn't trip the BUG() in notify_change. This also allows the lower filesystem to interpret ATTR_KILL_S*ID in its own way. Signed-off-by: Jeff Layton Cc: Michael Halcrow Cc: Christoph Hellwig Cc: Neil Brown Cc: "J. Bruce Fields" Cc: Chris Mason Cc: Jeff Mahoney Cc: "Vladimir V. Saveliev" Cc: Josef 'Jeff' Sipek Cc: Trond Myklebust Cc: Steven French Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c index 5701f816faf..0b1ab016fa2 100644 --- a/fs/ecryptfs/inode.c +++ b/fs/ecryptfs/inode.c @@ -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);