mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stephen Smalley <sds@tycho.nsa.gov>
To: Joe Perches <joe@perches.com>, Paul Moore <paul@paul-moore.com>,
	Eric Paris <eparis@parisplace.org>,
	James Morris <james.l.morris@oracle.com>,
	"Serge E. Hallyn" <serge@hallyn.com>,
	selinux@tycho.nsa.gov
Cc: linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] selinuxfs: Fix sel_write_enforce broken return value
Date: Tue, 24 Mar 2015 08:31:05 -0400	[thread overview]
Message-ID: <55115909.8080906@tycho.nsa.gov> (raw)
In-Reply-To: <1427158895.16851.70.camel@perches.com>

On 03/23/2015 09:01 PM, Joe Perches wrote:
> Return a negative error value like the rest
> of the entries in this function.
> 
> Signed-off-by: Joe Perches <joe@perches.com>

Acked-by:  Stephen Smalley <sds@tycho.nsa.gov>

> ---
> Maybe this should be stable, it goes back to
> commit b77a493b1dc8 ("SELinux: standardize return code
> handling in selinuxfs.c") back in Nov 2010, but it's
> guarded by a #ifdef CONFIG_SECURITY_SELINUX_DEVELOP
> so it probably doesn't matter much.

That option is enabled by most distributions that enable SELinux; it is
what enables support for permissive mode.

> 
>  security/selinux/selinuxfs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c
> index 1684bcc..5fde343 100644
> --- a/security/selinux/selinuxfs.c
> +++ b/security/selinux/selinuxfs.c
> @@ -152,7 +152,7 @@ static ssize_t sel_write_enforce(struct file *file, const char __user *buf,
>  		goto out;
>  
>  	/* No partial writes. */
> -	length = EINVAL;
> +	length = -EINVAL;
>  	if (*ppos != 0)
>  		goto out;
>  
> 
> 
> _______________________________________________
> Selinux mailing list
> Selinux@tycho.nsa.gov
> To unsubscribe, send email to Selinux-leave@tycho.nsa.gov.
> To get help, send an email containing "help" to Selinux-request@tycho.nsa.gov.
> 
> 


  reply	other threads:[~2015-03-24 12:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-24  1:01 Joe Perches
2015-03-24 12:31 ` Stephen Smalley [this message]
2015-03-26 10:08 ` Paul Moore

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=55115909.8080906@tycho.nsa.gov \
    --to=sds@tycho.nsa.gov \
    --cc=eparis@parisplace.org \
    --cc=james.l.morris@oracle.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=paul@paul-moore.com \
    --cc=selinux@tycho.nsa.gov \
    --cc=serge@hallyn.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

all inboxes | Powered by JetHome®