From: Stephen Smalley <sds@tycho.nsa.gov>
To: Dominick Grift <dominick.grift@gmail.com>,
selinux <selinux@tycho.nsa.gov>
Subject: Re: selinux_check_access() and unknown classes/perms
Date: Tue, 08 Jul 2014 14:04:37 -0400 [thread overview]
Message-ID: <53BC32B5.8020902@tycho.nsa.gov> (raw)
In-Reply-To: <1404564176.9852.44.camel@x220.localdomain>
[-- Attachment #1: Type: text/plain, Size: 143 bytes --]
On 07/05/2014 08:42 AM, Dominick Grift wrote:
> For reference:
>
> https://bugzilla.redhat.com/show_bug.cgi?id=1095354
Will this suffice?
[-- Attachment #2: 0001-Log-an-error-on-unknown-classes-and-permissions.patch --]
[-- Type: text/x-patch, Size: 1414 bytes --]
>From 7bdc38ccb21133155658279895b10ceb347b0b5a Mon Sep 17 00:00:00 2001
From: Stephen Smalley <sds@tycho.nsa.gov>
Date: Tue, 8 Jul 2014 14:03:39 -0400
Subject: [PATCH] Log an error on unknown classes and permissions.
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
---
libselinux/src/checkAccess.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libselinux/src/checkAccess.c b/libselinux/src/checkAccess.c
index 4d70ebe..cd2a817 100644
--- a/libselinux/src/checkAccess.c
+++ b/libselinux/src/checkAccess.c
@@ -7,6 +7,7 @@
#include <selinux/flask.h>
#include <selinux/avc.h>
#include <selinux/av_permissions.h>
+#include "avc_internal.h"
static pthread_once_t once = PTHREAD_ONCE_INIT;
@@ -38,6 +39,7 @@ int selinux_check_access(const char *scon, const char *tcon, const char *class,
sclass = string_to_security_class(class);
if (sclass == 0) {
rc = errno;
+ avc_log(SELINUX_ERROR, "Unknown class %s", class);
if (security_deny_unknown() == 0)
return 0;
errno = rc;
@@ -47,6 +49,7 @@ int selinux_check_access(const char *scon, const char *tcon, const char *class,
av = string_to_av_perm(sclass, perm);
if (av == 0) {
rc = errno;
+ avc_log(SELINUX_ERROR, "Unknown permission %s for class %s", perm, class);
if (security_deny_unknown() == 0)
return 0;
errno = rc;
--
1.8.3.1
next prev parent reply other threads:[~2014-07-08 18:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-29 21:14 selinux_check_access() and unknown classes/perms Eric Paris
2014-04-29 22:18 ` Dominick Grift
2014-04-30 0:02 ` Stephen Smalley
2014-04-30 12:58 ` Daniel J Walsh
2014-07-05 12:08 ` Laurent Bigonville
2014-07-05 12:42 ` Dominick Grift
2014-07-08 18:04 ` Stephen Smalley [this message]
2014-07-08 18:25 ` Dominick Grift
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=53BC32B5.8020902@tycho.nsa.gov \
--to=sds@tycho.nsa.gov \
--cc=dominick.grift@gmail.com \
--cc=selinux@tycho.nsa.gov \
/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.