Skip to content

Commit d4a141c

Browse files
jtlaytonJames Morris
authored andcommitted
security: have cap_dentry_init_security return error
Currently, cap_dentry_init_security returns 0 without actually initializing the security label. This confuses its only caller (nfs4_label_init_security) which expects an error in that situation, and causes it to end up sending out junk onto the wire instead of simply suppressing the label in the attributes sent. When CONFIG_SECURITY is disabled, security_dentry_init_security returns -EOPNOTSUPP. Have cap_dentry_init_security do the same. Signed-off-by: Jeff Layton <jlayton@redhat.com> Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com> Signed-off-by: James Morris <james.l.morris@oracle.com>
1 parent 864f32a commit d4a141c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎security/capability.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ static int cap_dentry_init_security(struct dentry *dentry, int mode,
116116
struct qstr *name, void **ctx,
117117
u32 *ctxlen)
118118
{
119-
return 0;
119+
return -EOPNOTSUPP;
120120
}
121121

122122
static int cap_inode_alloc_security(struct inode *inode)

0 commit comments

Comments
 (0)