All of lore.kernel.org
 help / color / mirror / Atom feed
* Threaded applications and "execmem" privilege
@ 2005-11-20 16:35 Erich Schubert
  2005-11-22 15:17 ` Erich Schubert
  0 siblings, 1 reply; 6+ messages in thread
From: Erich Schubert @ 2005-11-20 16:35 UTC (permalink / raw)
  To: SELinux

Hi,
I've been trying to find out how to avoid the "execmem" errors you e.g.
get in "host" (from the bind package, using the resolver library from
bind...), "dig" and "bind" itself.

Apaprently this is due to using threads - as far as I can tell, any
application using threads on Linux will do a mmap with "PROT_READ |
PROT_WRITE | PROT_EXEC",
which will trigger the execmem hook of SELinux.

Now that is really annyoing: either I need to enable "execmem" for most
domains, or write new domains for stuff like "host" and "dig" and add
appropriate execute transitions to tons of domains. :-(

It would probably be possible to remove PROT_EXEC from the mmap in the
threads library, but I bet there are some applications relying on
it... :-(
Another option would be to modify the threads library to try with
PROT_EXEC first, then retry without. Then a "dontaudit" rule for some
applications should be fine as well...

Anyone here deep enough in the thread libraries to know whether
PROT_EXEC is actually needed and/or what it's going to break?

Can some people try to run "dig" or the "host" command from bind (NOT
the dnsutils version, which probably doesn't use libpthread) and check
wheter they need the execmem permission for it, too?
And otherwise maybe find out how their thread library avoids using both
PROT_WRITE and PROT_EXEC on the same mmap...

best regards,
Erich Schubert
-- 
    erich@(vitavonni.de|debian.org)    --    GPG Key ID: 4B3A135C   (o_
   There was never a good war or a bad peace. - Benjamin Franklin   //\
               Für jedes Problem gibt es eine Lösung,               V_/_
                  die einfach, klar und falsch ist.



--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

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

end of thread, other threads:[~2005-11-28 16:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-20 16:35 Threaded applications and "execmem" privilege Erich Schubert
2005-11-22 15:17 ` Erich Schubert
2005-11-28 14:31   ` Stephen Smalley
2005-11-28 15:18     ` Erich Schubert
2005-11-28 15:36       ` Stephen Smalley
2005-11-28 16:04       ` Lorenzo Hernandez Garcia-Hierro

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.