Message ID | 20230825161603.371792-3-harshit.m.mogalapalli@oracle.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Address ltp nfs test failure. | expand |
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index 155b34c4683c..4c11046800ab 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c @@ -321,7 +321,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); } } }