All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Smalley <sds@tycho.nsa.gov>
To: Zhi Xin <xinzhi@marvell.com>, Gaurav Gangwar <gauravgangwaar@gmail.com>
Cc: "seandroid-list@tycho.nsa.gov" <seandroid-list@tycho.nsa.gov>,
	"selinux@tycho.nsa.gov" <selinux@tycho.nsa.gov>
Subject: Re: Give out all the avc logs in ome time
Date: Tue, 05 May 2015 09:41:49 -0400	[thread overview]
Message-ID: <5548C89D.2020601@tycho.nsa.gov> (raw)
In-Reply-To: <F766E4F80769BD478052FB6533FA745D66611C4124@SC-VEXCH4.marvell.com>

On 05/05/2015 04:55 AM, Zhi Xin wrote:
> (1)  avc size
> 
> I’m reading the code under
> 
> /kernel/security/selinux/avc.c
> 
>  
> 
> I noticed that there are some macro like
> 
> #define      AVC_DEF_CACHE_THRESHOLD              512
> 
> #define      AVC_CACHE_SLOTS                                    512
> 
>  
> 
> Are they some kind of threshold ? If the size of avc log reported is
> bigger than that, new avc will be abandoned ?

No, that has nothing to do with auditing.  Just the size of the cache.

> (2) audit subsystem may drop some record when it’s satisfied with some
> condition like
> 
>  
> 
> /kernel/kernel/audit.c
> 
> 115 <http://10.38.120.31:8080/source/xref/pxa1928-lp5.0/kernel/kernel/audit.c#115>/* Records can be lost in several ways:
> 
> 116 <http://10.38.120.31:8080/source/xref/pxa1928-lp5.0/kernel/kernel/audit.c#116>   0) [suppressed in audit_alloc]
> 
> 117 <http://10.38.120.31:8080/source/xref/pxa1928-lp5.0/kernel/kernel/audit.c#117>   1) out of memory in audit_log_start [kmalloc of struct audit_buffer]
> 
> 118 <http://10.38.120.31:8080/source/xref/pxa1928-lp5.0/kernel/kernel/audit.c#118>   2) out of memory in audit_log_move [alloc_skb]
> 
> 119 <http://10.38.120.31:8080/source/xref/pxa1928-lp5.0/kernel/kernel/audit.c#119>   3) suppressed due to audit_rate_limit
> 
> 120 <http://10.38.120.31:8080/source/xref/pxa1928-lp5.0/kernel/kernel/audit.c#120>   4) suppressed due to audit_backlog_limit
> 
> 121 <http://10.38.120.31:8080/source/xref/pxa1928-lp5.0/kernel/kernel/audit.c#121>*/
> 
>  
> 
> Any comments on these two ? 

Yes, one of the above cases is the most likely reason you are losing
audit messages.  You can set the audit_rate_limit to zero to disable
ratelimiting of audit messages by removing the code from
system/core/logd/libaudit.c that sets it.  You could set the
audit_backlog_limit to zero either by patching your kernel or by
modifying logd to set it.  You can patch your kernel to disable
printk_ratelimit from being applied when sending audit messages to the
kernel ring buffer.

  reply	other threads:[~2015-05-05 13:41 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-05  2:06 Give out all the avc logs in ome time Zhi Xin
2015-05-05  2:37 ` William Roberts
2015-05-05  2:43   ` Zhi Xin
2015-05-05  2:51     ` William Roberts
2015-05-05  3:00       ` William Roberts
2015-05-05  5:55   ` Ravi Kumar
2015-05-05  7:32     ` Zhi Xin
2015-05-05  8:39       ` Gaurav Gangwar
2015-05-05  8:55         ` Zhi Xin
2015-05-05 13:41           ` Stephen Smalley [this message]
2015-05-05 14:06             ` william.c.roberts
2015-05-05 12:41 ` Stephen Smalley
2015-05-06  2:18   ` Zhi Xin
2015-05-06 12:19     ` Stephen Smalley
2015-05-07  3:18       ` Zhi Xin
2015-05-07  4:02         ` William Roberts
2015-05-07 13:00         ` Stephen Smalley
2015-05-08  8:46           ` Zhi Xin
2015-05-08 12:57             ` Stephen Smalley
2015-05-08 13:31               ` Paul Moore

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5548C89D.2020601@tycho.nsa.gov \
    --to=sds@tycho.nsa.gov \
    --cc=gauravgangwaar@gmail.com \
    --cc=seandroid-list@tycho.nsa.gov \
    --cc=selinux@tycho.nsa.gov \
    --cc=xinzhi@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.