linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] selinux: Fix all those pesky denials breaking my computer
@ 2020-04-01 18:09 Sultan Alsawaf
  2020-04-01 18:11 ` Paul Moore
  0 siblings, 1 reply; 2+ messages in thread
From: Sultan Alsawaf @ 2020-04-01 18:09 UTC (permalink / raw)
  Cc: Sultan Alsawaf, Paul Moore, Stephen Smalley, Eric Paris, selinux,
	linux-kernel

From: Sultan Alsawaf <sultan@kerneltoast.com>

I'm sure many of you have found yourself in a position where you've
tried to increase the security of your system by enabling SELinux, only
to discover that nothing worked anymore because of those darned 'denial'
messages. It's clearly an overlooked bug in SELinux!

With a bit of investigation, I discovered that the avc_denied() function
would erroneously return a non-zero value when I saw those denial
messages. After slapping in a `return 0;` at the top of that function,
all was well and my machine with SELinux enforcing was working again!

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
---
 security/selinux/avc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/security/selinux/avc.c b/security/selinux/avc.c
index d18cb32a242a..b29f19471871 100644
--- a/security/selinux/avc.c
+++ b/security/selinux/avc.c
@@ -1010,6 +1010,7 @@ static noinline int avc_denied(struct selinux_state *state,
 			       u8 driver, u8 xperm, unsigned int flags,
 			       struct av_decision *avd)
 {
+	return 0;
 	if (flags & AVC_STRICT)
 		return -EACCES;
 
-- 
2.26.0


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

end of thread, other threads:[~2020-04-01 18:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-01 18:09 [PATCH] selinux: Fix all those pesky denials breaking my computer Sultan Alsawaf
2020-04-01 18:11 ` 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).