Commit d4a141c8e77043bd674dd6aa0b40bc3675cb7b1d

Authored by Jeff Layton
Committed by James Morris
1 parent 864f32a52b

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>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

security/capability.c
... ... @@ -116,7 +116,7 @@
116 116 struct qstr *name, void **ctx,
117 117 u32 *ctxlen)
118 118 {
119   - return 0;
  119 + return -EOPNOTSUPP;
120 120 }
121 121  
122 122 static int cap_inode_alloc_security(struct inode *inode)