All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] SELinux: Make selinux_kernel_create_files_as() shouldn't just always return 0
@ 2010-02-26  1:56 David Howells
  2010-02-26  3:56 ` James Morris
  0 siblings, 1 reply; 2+ messages in thread
From: David Howells @ 2010-02-26  1:56 UTC (permalink / raw)
  To: jmorris; +Cc: dhowells, linux-security-module, linux-kernel

Make selinux_kernel_create_files_as() return an error when it gets one, rather
than unconditionally returning 0.

Without this, cachefiles doesn't return an error if the SELinux policy doesn't
let it create files with the label of the directory at the base of the cache.

Signed-off-by: David Howells <dhowells@redhat.com>
---

 security/selinux/hooks.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 9a2ee84..99a7707 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -3334,7 +3334,7 @@ static int selinux_kernel_create_files_as(struct cred *new, struct inode *inode)
 
 	if (ret == 0)
 		tsec->create_sid = isec->sid;
-	return 0;
+	return ret;
 }
 
 static int selinux_kernel_module_request(char *kmod_name)


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] SELinux: Make selinux_kernel_create_files_as() shouldn't just always return 0
  2010-02-26  1:56 [PATCH] SELinux: Make selinux_kernel_create_files_as() shouldn't just always return 0 David Howells
@ 2010-02-26  3:56 ` James Morris
  0 siblings, 0 replies; 2+ messages in thread
From: James Morris @ 2010-02-26  3:56 UTC (permalink / raw)
  To: David Howells; +Cc: linux-security-module, linux-kernel

On Fri, 26 Feb 2010, David Howells wrote:

> Make selinux_kernel_create_files_as() return an error when it gets one, rather
> than unconditionally returning 0.
> 
> Without this, cachefiles doesn't return an error if the SELinux policy doesn't
> let it create files with the label of the directory at the base of the cache.
> 
> Signed-off-by: David Howells <dhowells@redhat.com>


Applied to
git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6#next

-- 
James Morris
<jmorris@namei.org>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-02-26  3:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-26  1:56 [PATCH] SELinux: Make selinux_kernel_create_files_as() shouldn't just always return 0 David Howells
2010-02-26  3:56 ` James Morris

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.