linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [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

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).