Linux NFS development
 help / color / mirror / Atom feed
From: Serge Hallyn <serge.hallyn@ubuntu.com>
To: Jeff Layton <jlayton@redhat.com>
Cc: James Morris <james.l.morris@oracle.com>,
	Serge Hallyn <serge.hallyn@canonical.com>,
	linux-security-module@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-nfs@vger.kernel.org
Subject: Re: [PATCH] security: have cap_dentry_init_security return error
Date: Thu, 6 Mar 2014 09:30:42 -0600	[thread overview]
Message-ID: <20140306153042.GA14791@sergelap> (raw)
In-Reply-To: <1394041657-7114-1-git-send-email-jlayton@redhat.com>

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
> 

  reply	other threads:[~2014-03-06 15:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-05 17:47 [PATCH] security: have cap_dentry_init_security return error Jeff Layton
2014-03-06 15:30 ` Serge Hallyn [this message]
2014-03-07  0:42 ` James Morris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140306153042.GA14791@sergelap \
    --to=serge.hallyn@ubuntu.com \
    --cc=james.l.morris@oracle.com \
    --cc=jlayton@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=serge.hallyn@canonical.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox