* tracking down execstack & execmem violations
@ 2008-06-10 17:10 Clarkson, Mike R (US SSA)
2008-06-10 17:15 ` Stephen Smalley
0 siblings, 1 reply; 7+ messages in thread
From: Clarkson, Mike R (US SSA) @ 2008-06-10 17:10 UTC (permalink / raw)
To: selinux
I'm writing a policy for a very large legacy CORBA application, with
many separate processes. Without fail, every one of our processes
requires execstack & execmem privileges. I would like to track down the
cause, but I really don't have any idea how. Does anybody have any good
recommendations?
I'd like to at least be able to determine whether the offending code is
ours or some vender's (like our CORBA vender), and if it is ours I'd
like to track down the source. I'm betting there is a common source
causing the issue.
Thanks
--
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] 7+ messages in thread
* Re: tracking down execstack & execmem violations
2008-06-10 17:10 tracking down execstack & execmem violations Clarkson, Mike R (US SSA)
@ 2008-06-10 17:15 ` Stephen Smalley
2008-06-10 17:23 ` Clarkson, Mike R (US SSA)
0 siblings, 1 reply; 7+ messages in thread
From: Stephen Smalley @ 2008-06-10 17:15 UTC (permalink / raw)
To: Clarkson, Mike R (US SSA); +Cc: selinux
On Tue, 2008-06-10 at 10:10 -0700, Clarkson, Mike R (US SSA) wrote:
> I'm writing a policy for a very large legacy CORBA application, with
> many separate processes. Without fail, every one of our processes
> requires execstack & execmem privileges. I would like to track down the
> cause, but I really don't have any idea how. Does anybody have any good
> recommendations?
>
> I'd like to at least be able to determine whether the offending code is
> ours or some vender's (like our CORBA vender), and if it is ours I'd
> like to track down the source. I'm betting there is a common source
> causing the issue.
Resources:
http://people.redhat.com/drepper/selinux-mem.html
http://people.redhat.com/drepper/nonselsec.pdf
Also, what does execstack -q show for the executables in question?
And are these programs:
- multi-threaded?,
- Java-based?
--
Stephen Smalley
National Security Agency
--
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] 7+ messages in thread
* RE: tracking down execstack & execmem violations
2008-06-10 17:15 ` Stephen Smalley
@ 2008-06-10 17:23 ` Clarkson, Mike R (US SSA)
2008-06-10 17:49 ` Stephen Smalley
0 siblings, 1 reply; 7+ messages in thread
From: Clarkson, Mike R (US SSA) @ 2008-06-10 17:23 UTC (permalink / raw)
To: Stephen Smalley; +Cc: selinux
> -----Original Message-----
> From: Stephen Smalley [mailto:sds@tycho.nsa.gov]
> Sent: Tuesday, June 10, 2008 10:15 AM
> To: Clarkson, Mike R (US SSA)
> Cc: selinux@tycho.nsa.gov
> Subject: Re: tracking down execstack & execmem violations
>
>
> On Tue, 2008-06-10 at 10:10 -0700, Clarkson, Mike R (US SSA) wrote:
> > I'm writing a policy for a very large legacy CORBA application, with
> > many separate processes. Without fail, every one of our processes
> > requires execstack & execmem privileges. I would like to track down
the
> > cause, but I really don't have any idea how. Does anybody have any
good
> > recommendations?
> >
> > I'd like to at least be able to determine whether the offending code
is
> > ours or some vender's (like our CORBA vender), and if it is ours I'd
> > like to track down the source. I'm betting there is a common source
> > causing the issue.
>
> Resources:
> http://people.redhat.com/drepper/selinux-mem.html
> http://people.redhat.com/drepper/nonselsec.pdf
I'll look at these. Thanks!
>
> Also, what does execstack -q show for the executables in question?
I wasn't aware of the execstack cmd. This alone will help a lot. Thanks
again.
> And are these programs:
> - multi-threaded?,
> - Java-based?
Mostly C++ but a few Java. Nearly all are multi-threaded.
>
> --
> Stephen Smalley
> National Security Agency
--
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] 7+ messages in thread
* RE: tracking down execstack & execmem violations
2008-06-10 17:23 ` Clarkson, Mike R (US SSA)
@ 2008-06-10 17:49 ` Stephen Smalley
2008-06-10 18:00 ` Eric Paris
0 siblings, 1 reply; 7+ messages in thread
From: Stephen Smalley @ 2008-06-10 17:49 UTC (permalink / raw)
To: Clarkson, Mike R (US SSA)
Cc: selinux, Eric Paris, Daniel J Walsh, James Morris
On Tue, 2008-06-10 at 10:23 -0700, Clarkson, Mike R (US SSA) wrote:
>
> > -----Original Message-----
> > From: Stephen Smalley [mailto:sds@tycho.nsa.gov]
> > Sent: Tuesday, June 10, 2008 10:15 AM
> > To: Clarkson, Mike R (US SSA)
> > Cc: selinux@tycho.nsa.gov
> > Subject: Re: tracking down execstack & execmem violations
> >
> >
> > On Tue, 2008-06-10 at 10:10 -0700, Clarkson, Mike R (US SSA) wrote:
> > > I'm writing a policy for a very large legacy CORBA application, with
> > > many separate processes. Without fail, every one of our processes
> > > requires execstack & execmem privileges. I would like to track down
> the
> > > cause, but I really don't have any idea how. Does anybody have any
> good
> > > recommendations?
> > >
> > > I'd like to at least be able to determine whether the offending code
> is
> > > ours or some vender's (like our CORBA vender), and if it is ours I'd
> > > like to track down the source. I'm betting there is a common source
> > > causing the issue.
> >
> > Resources:
> > http://people.redhat.com/drepper/selinux-mem.html
> > http://people.redhat.com/drepper/nonselsec.pdf
>
> I'll look at these. Thanks!
> >
> > Also, what does execstack -q show for the executables in question?
>
> I wasn't aware of the execstack cmd. This alone will help a lot. Thanks
> again.
>
> > And are these programs:
> > - multi-threaded?,
> > - Java-based?
>
> Mostly C++ but a few Java. Nearly all are multi-threaded.
Java is known to require execmem for runtime code generation. There is
a java_t domain that you can look at as an example. I think they allow
it execstack too, although I'm not as clear as to why that is necessary,
possibly for the thread stack allocation.
Thread stacks may be allocated with PROT_EXEC if the executable is
marked as requiring an executable stack or if it lacks the marking;
execstack should tell you the story there.
If we can't give execmem w/o giving execstack too, then execstack isn't
useful as a separate permission.
--
Stephen Smalley
National Security Agency
--
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] 7+ messages in thread
* Re: tracking down execstack & execmem violations
2008-06-10 17:49 ` Stephen Smalley
@ 2008-06-10 18:00 ` Eric Paris
2008-06-10 18:03 ` Daniel J Walsh
2008-06-10 18:21 ` Stephen Smalley
0 siblings, 2 replies; 7+ messages in thread
From: Eric Paris @ 2008-06-10 18:00 UTC (permalink / raw)
To: Stephen Smalley
Cc: Clarkson, Mike R (US SSA), selinux, Daniel J Walsh, James Morris
On Tue, Jun 10, 2008 at 1:49 PM, Stephen Smalley <sds@tycho.nsa.gov> wrote:
> Java is known to require execmem for runtime code generation. There is
> a java_t domain that you can look at as an example. I think they allow
> it execstack too, although I'm not as clear as to why that is necessary,
> possibly for the thread stack allocation.
>
> Thread stacks may be allocated with PROT_EXEC if the executable is
> marked as requiring an executable stack or if it lacks the marking;
> execstack should tell you the story there.
>
> If we can't give execmem w/o giving execstack too, then execstack isn't
> useful as a separate permission.
As I recall, which is always a dangerous thing for me todo, execstack
needs execmem for multithreaded processes because the 'stack' of the
second thread is just 'memory' from the point of view of the
permission checks.
execmem does not need execstack.....
java probably actually uses an executable stack which is why it needs both.....
--
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] 7+ messages in thread
* Re: tracking down execstack & execmem violations
2008-06-10 18:00 ` Eric Paris
@ 2008-06-10 18:03 ` Daniel J Walsh
2008-06-10 18:21 ` Stephen Smalley
1 sibling, 0 replies; 7+ messages in thread
From: Daniel J Walsh @ 2008-06-10 18:03 UTC (permalink / raw)
To: Eric Paris
Cc: Stephen Smalley, Clarkson, Mike R (US SSA), selinux, James Morris
Eric Paris wrote:
> On Tue, Jun 10, 2008 at 1:49 PM, Stephen Smalley <sds@tycho.nsa.gov> wrote:
>
>> Java is known to require execmem for runtime code generation. There is
>> a java_t domain that you can look at as an example. I think they allow
>> it execstack too, although I'm not as clear as to why that is necessary,
>> possibly for the thread stack allocation.
>>
>> Thread stacks may be allocated with PROT_EXEC if the executable is
>> marked as requiring an executable stack or if it lacks the marking;
>> execstack should tell you the story there.
>>
>> If we can't give execmem w/o giving execstack too, then execstack isn't
>> useful as a separate permission.
>
> As I recall, which is always a dangerous thing for me todo, execstack
> needs execmem for multithreaded processes because the 'stack' of the
> second thread is just 'memory' from the point of view of the
> permission checks.
>
> execmem does not need execstack.....
>
> java probably actually uses an executable stack which is why it needs both.....
I believe it was only one of the java implementations that needed
execstack. The others did not, but it was either to just allow it for all.
--
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] 7+ messages in thread
* Re: tracking down execstack & execmem violations
2008-06-10 18:00 ` Eric Paris
2008-06-10 18:03 ` Daniel J Walsh
@ 2008-06-10 18:21 ` Stephen Smalley
1 sibling, 0 replies; 7+ messages in thread
From: Stephen Smalley @ 2008-06-10 18:21 UTC (permalink / raw)
To: Eric Paris
Cc: Clarkson, Mike R (US SSA), selinux, Daniel J Walsh, James Morris
On Tue, 2008-06-10 at 14:00 -0400, Eric Paris wrote:
> On Tue, Jun 10, 2008 at 1:49 PM, Stephen Smalley <sds@tycho.nsa.gov> wrote:
>
> > Java is known to require execmem for runtime code generation. There is
> > a java_t domain that you can look at as an example. I think they allow
> > it execstack too, although I'm not as clear as to why that is necessary,
> > possibly for the thread stack allocation.
> >
> > Thread stacks may be allocated with PROT_EXEC if the executable is
> > marked as requiring an executable stack or if it lacks the marking;
> > execstack should tell you the story there.
> >
> > If we can't give execmem w/o giving execstack too, then execstack isn't
> > useful as a separate permission.
>
> As I recall, which is always a dangerous thing for me todo, execstack
> needs execmem for multithreaded processes because the 'stack' of the
> second thread is just 'memory' from the point of view of the
> permission checks.
Yes, that one I understand and am ok with.
> execmem does not need execstack.....
That is theoretically true but I wasn't sure we had real working
examples of programs that only require the former and not the latter.
> java probably actually uses an executable stack which is why it needs both.....
--
Stephen Smalley
National Security Agency
--
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] 7+ messages in thread
end of thread, other threads:[~2008-06-10 18:21 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-10 17:10 tracking down execstack & execmem violations Clarkson, Mike R (US SSA)
2008-06-10 17:15 ` Stephen Smalley
2008-06-10 17:23 ` Clarkson, Mike R (US SSA)
2008-06-10 17:49 ` Stephen Smalley
2008-06-10 18:00 ` Eric Paris
2008-06-10 18:03 ` Daniel J Walsh
2008-06-10 18:21 ` Stephen Smalley
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.