Message ID | 20230825161901.371818-3-harshit.m.mogalapalli@oracle.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Address nfs ltp test failure. | expand |
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index d4adc599737d..15a86876e3d9 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c @@ -322,7 +322,9 @@ nfsd_sanitize_attrs(struct inode *inode, struct iattr *iap) iap->ia_mode &= ~S_ISGID; } else { /* set ATTR_KILL_* bits and let VFS handle it */ - iap->ia_valid |= (ATTR_KILL_SUID | ATTR_KILL_SGID); + iap->ia_valid |= ATTR_KILL_SUID; + iap->ia_valid |= + setattr_should_drop_sgid(&init_user_ns, inode); } } }