All of lore.kernel.org
 help / color / mirror / Atom feed
* Signal problem
@ 2005-04-26 19:23 Steve G
  2005-04-26 19:51 ` Stephen Smalley
  2005-04-26 19:56 ` Stephen Smalley
  0 siblings, 2 replies; 10+ messages in thread
From: Steve G @ 2005-04-26 19:23 UTC (permalink / raw)
  To: selinux

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 majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: Signal problem
@ 2005-04-26 20:18 Steve G
  2005-04-26 20:28 ` Chris Wright
  2005-04-27 11:25 ` Stephen Smalley
  0 siblings, 2 replies; 10+ messages in thread
From: Steve G @ 2005-04-26 20:18 UTC (permalink / raw)
  To: Stephen Smalley; +Cc: selinux

>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?

The message would be in syslog in that scenario. It isn't there either.

-Steve


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - Helps protect you from nasty viruses. 
http://promotions.yahoo.com/new_mail

--
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] 10+ messages in thread
* Re: Signal problem
@ 2005-04-26 20:38 Steve G
  2005-04-26 20:48 ` Chris Wright
  0 siblings, 1 reply; 10+ messages in thread
From: Steve G @ 2005-04-26 20:38 UTC (permalink / raw)
  To: Chris Wright; +Cc: Stephen Smalley, selinux

>Upon termination, what's queued to the netlink socket but not yet
>received is going to be lost, right?

I've also tested with nonfatal signals. This bug has been verified by other
people, too.

>Perhaps you need to be able to set pid == 0, and still drain the fd 
>when you recieve a TERM?

There's no way to drain the netlink socket in a race-free way. I've created a
whole new technique as a consequence. I'm just down to placing the hook.

-Steve

__________________________________________________
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 majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

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

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

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-26 19:23 Signal problem Steve G
2005-04-26 19:51 ` Stephen Smalley
2005-04-26 20:13   ` Chris Wright
2005-04-26 19:56 ` Stephen Smalley
2005-04-26 20:16   ` Chris Wright
  -- strict thread matches above, loose matches on Subject: below --
2005-04-26 20:18 Steve G
2005-04-26 20:28 ` Chris Wright
2005-04-27 11:25 ` Stephen Smalley
2005-04-26 20:38 Steve G
2005-04-26 20:48 ` Chris Wright

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.