All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] selinux: Don't sleep inside inode_getsecid hook
@ 2016-02-18 11:04 Andreas Gruenbacher
  2016-02-18 13:53 ` Stephen Smalley
  2016-02-19 21:34 ` Paul Moore
  0 siblings, 2 replies; 4+ messages in thread
From: Andreas Gruenbacher @ 2016-02-18 11:04 UTC (permalink / raw)
  To: Paul Moore, Stephen Smalley, Eric Paris, selinux

The inode_getsecid hook is called from contexts in which sleeping is not
allowed, so we cannot revalidate inode security labels from there. Use
the non-validating version of inode_security() instead.

Reported-by: Benjamin Coddington <bcodding@redhat.com> 
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
---
 security/selinux/hooks.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index f8110cf..f1ab715 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -3249,7 +3249,7 @@ static int selinux_inode_listsecurity(struct inode *inode, char *buffer, size_t
 
 static void selinux_inode_getsecid(struct inode *inode, u32 *secid)
 {
-	struct inode_security_struct *isec = inode_security(inode);
+	struct inode_security_struct *isec = inode_security_novalidate(inode);
 	*secid = isec->sid;
 }
 
-- 
2.4.3

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

end of thread, other threads:[~2016-02-19 21:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-18 11:04 [PATCH] selinux: Don't sleep inside inode_getsecid hook Andreas Gruenbacher
2016-02-18 13:53 ` Stephen Smalley
2016-02-18 14:04   ` Andreas Gruenbacher
2016-02-19 21:34 ` Paul Moore

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.