* [PATCH] selinuxfs: Fix sel_write_enforce broken return value
@ 2015-03-24 1:01 Joe Perches
2015-03-24 12:31 ` Stephen Smalley
2015-03-26 10:08 ` Paul Moore
0 siblings, 2 replies; 3+ messages in thread
From: Joe Perches @ 2015-03-24 1:01 UTC (permalink / raw)
To: Paul Moore, Stephen Smalley, Eric Paris, James Morris,
Serge E. Hallyn, selinux
Cc: linux-security-module, linux-kernel
Return a negative error value like the rest
of the entries in this function.
Signed-off-by: Joe Perches <joe@perches.com>
---
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.
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;
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] selinuxfs: Fix sel_write_enforce broken return value
2015-03-24 1:01 [PATCH] selinuxfs: Fix sel_write_enforce broken return value Joe Perches
@ 2015-03-24 12:31 ` Stephen Smalley
2015-03-26 10:08 ` Paul Moore
1 sibling, 0 replies; 3+ messages in thread
From: Stephen Smalley @ 2015-03-24 12:31 UTC (permalink / raw)
To: Joe Perches, Paul Moore, Eric Paris, James Morris,
Serge E. Hallyn, selinux
Cc: linux-security-module, linux-kernel
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.
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] selinuxfs: Fix sel_write_enforce broken return value
2015-03-24 1:01 [PATCH] selinuxfs: Fix sel_write_enforce broken return value Joe Perches
2015-03-24 12:31 ` Stephen Smalley
@ 2015-03-26 10:08 ` Paul Moore
1 sibling, 0 replies; 3+ messages in thread
From: Paul Moore @ 2015-03-26 10:08 UTC (permalink / raw)
To: Joe Perches
Cc: Stephen Smalley, Eric Paris, James Morris, Serge E. Hallyn,
selinux, linux-security-module, linux-kernel
Mon, Mar 23, 2015 at 9:01 PM, Joe Perches <joe@perches.com> wrote:
> Return a negative error value like the rest
> of the entries in this function.
>
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
> 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.
>
> security/selinux/selinuxfs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
My apologies, I hit reply and not reply-all to Stephen's ACK
mentioning that it might take me a day or two to merge this ...
regardless, it's merged now and marked for -stable; I also just sent a
pull request to James with this patch for v3.20.
Thanks for the fix.
> 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;
>
>
>
--
paul moore
www.paul-moore.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-03-26 10:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-24 1:01 [PATCH] selinuxfs: Fix sel_write_enforce broken return value Joe Perches
2015-03-24 12:31 ` Stephen Smalley
2015-03-26 10:08 ` Paul Moore
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).