Skip to contentSkip to conversation

Signal problem

DISCUSSION Steve G 3 participants 5 messages Apr 26, 2005 SELinux security module

lore
Share & tools
lore

Steve G

author
#0 lore raw

Hello,

I ran across a problem while working on the audit code that has SE Linux implications. The function security_task_kill does not hook all paths for signal entry/delivery. Just to make sure you know the piece of code I'm talking about:

http://lxr.linux.no/source/kernel/signal.c#L630

Some background -- we have a CAPP requirement to identify the sender of the TERM signal to the audit daemon. We placed a hook inside check_kill_permission(). It was called on a PPC, but my i686 kernel never sees it. I think there is some arch specific code that changes how signals are delivered on ix86.

My test was simply /etc/rc.d/init.d/auditd stop
and then look for a message stating the shutdown signal was received.

Using strace, the usual entry method was syscall 37 (kill). After that who knows what the code path is? I'm moving the audit hook to a whole new place to solve our problem. But I thought you might want to know about this since security_task_kill appears to be not hooking signals on all platforms.

-Steve Grubb

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#1 lore raw
Quoted 14 lines · Steve G

Hello,

I ran across a problem while working on the audit code that has SE Linux implications. The function security_task_kill does not hook all paths for signal entry/delivery. Just to make sure you know the piece of code I'm talking about:

http://lxr.linux.no/source/kernel/signal.c#L630

Some background -- we have a CAPP requirement to identify the sender of the TERM signal to the audit daemon. We placed a hook inside check_kill_permission(). It was called on a PPC, but my i686 kernel never sees it. I think there is some arch specific code that changes how signals are delivered on ix86.

Quoted 7 lines

My test was simply /etc/rc.d/init.d/auditd stop
and then look for a message stating the shutdown signal was received.

Using strace, the usual entry method was syscall 37 (kill). After that who knows what the code path is? I'm moving the audit hook to a whole new place to solve our problem. But I thought you might want to know about this since security_task_kill appears to be not hooking signals on all platforms.

Hmmmm...how certain are you? Basic testing of signal controls and auditing (via SELinux) seems to be working as expected here on x86.

Signature · 8 lines
Stephen Smalley <[email protected]>
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#2 lore raw
Quoted 4 lines · * Stephen Smalley ([email protected]) wrote:
Quoted 4 lines

Using strace, the usual entry method was syscall 37 (kill). After that who knows what the code path is? I'm moving the audit hook to a whole new place to solve our problem. But I thought you might want to know about this since security_task_kill appears to be not hooking signals on all platforms.

I think the hook is in the right spot.

Quoted 2 lines

Hmmmm...how certain are you? Basic testing of signal controls and auditing (via SELinux) seems to be working as expected here on x86.

Working fine here as well. I see the signal get sent each time I try it.

thanks,
-chris

Signature · 6 lines
Linux Security Modules     http://lsm.immunix.org     http://lsm.bkbits.net

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#3 lore raw
In reply to Steve G
Quoted 7 lines · Steve G

Some background -- we have a CAPP requirement to identify the sender of the TERM signal to the audit daemon. We placed a hook inside check_kill_permission(). It was called on a PPC, but my i686 kernel never sees it. I think there is some arch specific code that changes how signals are delivered on ix86.

My test was simply /etc/rc.d/init.d/auditd stop
and then look for a message stating the shutdown signal was received.

Isn't this unreliable anyway, e.g. your hook might queue up the audit message for processing by auditd, but auditd gets the signal before it handles the message and exits without emptying the queue?

Signature · 8 lines
Stephen Smalley <[email protected]>
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#4 lore raw
Quoted 6 lines · * Stephen Smalley ([email protected]) wrote:
Quoted 5 lines · Steve G

Some background -- we have a CAPP requirement to identify the sender of the TERM signal to the audit daemon. We placed a hook inside check_kill_permission(). It was called on a PPC, but my i686 kernel never sees it. I think there is some arch specific code that changes how signals are delivered on ix86.

Quoted 6 lines
Quoted 2 lines

My test was simply /etc/rc.d/init.d/auditd stop
and then look for a message stating the shutdown signal was received.

Isn't this unreliable anyway, e.g. your hook might queue up the audit message for processing by auditd, but auditd gets the signal before it handles the message and exits without emptying the queue?

Ah, right. That's the issue Steve's been wrestling with. There's not a nice race free way to ensure that audit message is delivered via auditd.

thanks,
-chris

Signature · 6 lines
Linux Security Modules     http://lsm.immunix.org     http://lsm.bkbits.net

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.