* [PATCH] security: have cap_dentry_init_security return error
@ 2014-03-05 17:47 Jeff Layton
2014-03-06 15:30 ` Serge Hallyn
2014-03-07 0:42 ` James Morris
0 siblings, 2 replies; 3+ messages in thread
From: Jeff Layton @ 2014-03-05 17:47 UTC (permalink / raw)
To: James Morris, Serge Hallyn; +Cc: linux-security-module, linux-kernel, linux-nfs
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>
---
security/capability.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/security/capability.c b/security/capability.c
index 8b4f24ae4338..9323bbeba296 100644
--- a/security/capability.c
+++ b/security/capability.c
@@ -116,7 +116,7 @@ static int cap_dentry_init_security(struct dentry *dentry, int mode,
struct qstr *name, void **ctx,
u32 *ctxlen)
{
- return 0;
+ return -EOPNOTSUPP;
}
static int cap_inode_alloc_security(struct inode *inode)
--
1.8.5.3
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] security: have cap_dentry_init_security return error
2014-03-05 17:47 [PATCH] security: have cap_dentry_init_security return error Jeff Layton
@ 2014-03-06 15:30 ` Serge Hallyn
2014-03-07 0:42 ` James Morris
1 sibling, 0 replies; 3+ messages in thread
From: Serge Hallyn @ 2014-03-06 15:30 UTC (permalink / raw)
To: Jeff Layton
Cc: James Morris, Serge Hallyn, linux-security-module, linux-kernel,
linux-nfs
Quoting Jeff Layton (jlayton@redhat.com):
> 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>
> ---
> security/capability.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/security/capability.c b/security/capability.c
> index 8b4f24ae4338..9323bbeba296 100644
> --- a/security/capability.c
> +++ b/security/capability.c
> @@ -116,7 +116,7 @@ static int cap_dentry_init_security(struct dentry *dentry, int mode,
> struct qstr *name, void **ctx,
> u32 *ctxlen)
> {
> - return 0;
> + return -EOPNOTSUPP;
> }
>
> static int cap_inode_alloc_security(struct inode *inode)
> --
> 1.8.5.3
>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] security: have cap_dentry_init_security return error
2014-03-05 17:47 [PATCH] security: have cap_dentry_init_security return error Jeff Layton
2014-03-06 15:30 ` Serge Hallyn
@ 2014-03-07 0:42 ` James Morris
1 sibling, 0 replies; 3+ messages in thread
From: James Morris @ 2014-03-07 0:42 UTC (permalink / raw)
To: Jeff Layton
Cc: James Morris, Serge Hallyn, linux-security-module, linux-kernel,
linux-nfs
On Wed, 5 Mar 2014, Jeff Layton wrote:
> 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>
Applied to
git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security.git next
--
James Morris
<jmorris@namei.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-03-07 0:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-05 17:47 [PATCH] security: have cap_dentry_init_security return error Jeff Layton
2014-03-06 15:30 ` Serge Hallyn
2014-03-07 0:42 ` James Morris
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox