<br><font size=2 face="sans-serif">We are talking about 2 different things:
1) handling disk full 2) suspending the process whenever there are no kernel
resources.</font>
<br>
<br><font size=2 face="sans-serif">1) For handling disk full I am doing
the following:</font>
<br><font size=2 face="sans-serif">Whenever the disk full (or log reached
its limit)  is detected the auditd sends an AUDIT_SUSPEND message
to the kernel. On receipt of this message the kernel will set a flag "disk_full_flag".
  If this disk_full_flag  is set audit_log_start will call audit_suspend
to queue the process in a wait queue. Whenever the disk_full_flag is reset
all the processes in the wait queue will be rescheduled.</font>
<br>
<br><font size=2 face="sans-serif">2) For suspending the process whenever
there are no kernel resources:</font>
<br><font size=2 face="sans-serif">I was thinking of using sigsuspend whenever
audit_log_lost is called depending on the "failure flag". The
failure flag currently can be set ,only, to: do nothing, print a message
or panic.  I was thinking to add a fourth option to this flag to suspend
the processes.</font>
<br><font size=2 face="sans-serif">sigsuspend puts the process in the TASK_INTERRUPTIBLE
state, the process will only wake up when a nonignored, nonblocked signal
is sent to it. From the dicussion so far this may not be a good way to
go about solving this requirement, specially if the process is holding
locks or whatever. I need to either add to this solution or come up with
a different one. </font>
<br>
<br>
<br>
<br><font size=2 face="sans-serif">Mounir Bsaibes<br>
Linux Security<br>
Tel:  (512) 838-1301<br>
Cell: (512) 762-9957<br>
Fax: (512) 838-8858<br>
e-mail: bsaibes@us.ibm.com</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>Stephen Smalley <sds@epoch.ncsc.mil></b>
</font>
<br><font size=1 face="sans-serif">Sent by: linux-audit-bounces@redhat.com</font>
<p><font size=1 face="sans-serif">12/15/2004 12:09 PM</font>
<table border>
<tr valign=top>
<td bgcolor=white>
<div align=center><font size=1 face="sans-serif">Please respond to<br>
Linux Audit Discussion</font></div></table>
<br>
<td width=59%>
<table width=100%>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td valign=top><font size=1 face="sans-serif">Linux Audit Discussion <linux-audit@redhat.com></font>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td valign=top>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td valign=top><font size=1 face="sans-serif">Re: handling disk full</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><font size=2><tt>On Wed, 2004-12-15 at 13:01, Klaus Weidner wrote:<br>
> Keep in mind that the CAPP audit requirements are fairly independent
from<br>
> the SELinux uses of the audit subsystem. <br>
> <br>
> CAPP requires that specific actions don't complete if they can't be<br>
> audited, and those events will in general occur from a syscall context<br>
> where a sleep should not be a problem.<br>
<br>
1) What does "can't be audited" mean - that we couldn't send
the audit<br>
record to userspace or that it couldn't reach the disk?<br>
2) Even from process context, you'd have to make sure that the caller is<br>
never holding a lock when it calls audit_log*.<br>
<br>
> The events generated by SELinux are not required by CAPP, and it's
not a<br>
> problem for CAPP compliance if those messages get discarded if there
is<br>
> no room for them and the kernel can't sleep.<br>
<br>
Possibly, but audit_log* can't automatically detect whether it is safe<br>
to sleep.  Caller will have to provide that information via a flag
or<br>
alternate interface.  <br>
<br>
In any event, use of sigsuspend seems questionable.<br>
<br>
-- <br>
Stephen Smalley <sds@epoch.ncsc.mil><br>
National Security Agency<br>
<br>
--<br>
Linux-audit mailing list<br>
Linux-audit@redhat.com<br>
http://www.redhat.com/mailman/listinfo/linux-audit<br>
</tt></font>
<br>