All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sultan Alsawaf <sultan@kerneltoast.com>
To: unlisted-recipients:; (no To-header on input)
Cc: Sultan Alsawaf <sultan@kerneltoast.com>,
	Paul Moore <paul@paul-moore.com>,
	Stephen Smalley <sds@tycho.nsa.gov>,
	Eric Paris <eparis@parisplace.org>,
	selinux@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] selinux: Fix all those pesky denials breaking my computer
Date: Wed,  1 Apr 2020 11:09:19 -0700	[thread overview]
Message-ID: <20200401180920.4655-1-sultan@kerneltoast.com> (raw)

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


             reply	other threads:[~2020-04-01 18:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-01 18:09 Sultan Alsawaf [this message]
2020-04-01 18:11 ` [PATCH] selinux: Fix all those pesky denials breaking my computer Paul Moore

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200401180920.4655-1-sultan@kerneltoast.com \
    --to=sultan@kerneltoast.com \
    --cc=eparis@parisplace.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paul@paul-moore.com \
    --cc=sds@tycho.nsa.gov \
    --cc=selinux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.