All of lore.kernel.org
 help / color / mirror / Atom feed
* selinux_check_access() and unknown classes/perms
@ 2014-04-29 21:14 Eric Paris
  2014-04-29 22:18 ` Dominick Grift
  2014-04-30  0:02 ` Stephen Smalley
  0 siblings, 2 replies; 8+ messages in thread
From: Eric Paris @ 2014-04-29 21:14 UTC (permalink / raw)
  To: SE-Linux, Dominick Grift

selinux_check_access() has code like this:

       sclass = string_to_security_class(class);
       if (sclass == 0) {
               rc = errno;
               if (security_deny_unknown() == 0)
                       return 0;
               errno = rc;
               return -1;
       }

My problem with the code is that we have no logging of any kind why we
just returned -1;  The reason this was found is because Dominick is
writing custom policy that doesn't define all of the classes/perms
used by systemd and has security_deny_unknown() == 1.  systemd calls
selinux_check_access() gets -EINVAL, prints that it denied, but no
where do we have a good reason why it was denied.  systemd doesn't
know, it's hidden in this library...

A good first step would be to call avc_log(SELINUX_ERR, ...) in the
case where we return an error.  But what do we do in the
security_deny_unknown() == 0 case?  I'd still like to call avc_log,
but only do it once rather than flood our logs.  Any suggestions how
to pull that off?

-Eric

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

end of thread, other threads:[~2014-07-08 18:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2014-07-08 18:25           ` Dominick Grift

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.