<br><br><div class="gmail_quote">On Mon, Dec 12, 2011 at 6:40 AM, Steve Grubb <span dir="ltr"><<a href="mailto:sgrubb@redhat.com">sgrubb@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="im">On Sunday, December 11, 2011 02:09:27 PM Peter Moody wrote:<br>
> This patch extends Eric's test patch from 11/17 (<br>
> <a href="http://www.redhat.com/archives/linux-audit/2011-November/msg00045.html" target="_blank">http://www.redhat.com/archives/linux-audit/2011-November/msg00045.html</a>).<br>
> This turns -C into a long opt with similar syntax to -F.<br>
<br>
</div>Thanks.<br>
<div class="im"><br>
> One strange thing related to this patch: auditd seems to be reporting<br>
> success for a normal user process (gklrellm) opening /proc/meminfo (mode<br>
> 444) O_RDWR, and I don't see how this is possible.  eg:<br>
><br>
> type=SYSCALL msg=audit(1323540255.146:97): arch=c000003e syscall=2<br>
> success=yes exit=13 a0=4b1972 a1=0 a2=1b6 a3=0 items=1 ppid=1704 pid=1797<br>
> auid=11532 uid=11532 gid=5000 euid=11532 suid=11532 fsuid=11532 egid=5000<br>
> sgid=5000 fsgid=5000 tty=(none) ses=1 comm="gkrellm" exe="/usr/bin/gkrellm"<br>
> key="permissive"<br>
> type=CWD msg=audit(1323540255.146:97):  cwd="/home/pmoody"<br>
> type=PATH msg=audit(1323540255.146:97): item=0 name="/proc/meminfo" inode=<br>
> <a href="tel:4026532008" value="+14026532008">4026532008</a> dev=00:03 mode=0100444 ouid=0 ogid=0 rdev=00:00<br>
><br>
> hopefully someone with more auditd internal knowledge can explain what's<br>
> going on.<br>
<br>
</div>Simple, int open(const char *pathname, int flags, mode_t mode);<br>
<br>
So, we want to look at a1's contents. </blockquote><div><br></div><div>d'oh, of course. I keep thinking it's a2 for some reason.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Its a zero. So, let's look that up in<br>
/usr/include/asm-generic/fcntl.h:<br>
<br>
#define O_RDONLY        00000000<br>
#define O_WRONLY        00000001<br>
#define O_RDWR          00000002<br>
<br>
So, it would appear open is called with O_RDONLY, which is allowed by the<br>
permissions 0444.<br>
<div class="im"><br>
<br>
> auditctl -l doesn't know how to report this yet; if this patch is generally<br>
> acceptable, I can try to fix that and update the manpage, etc.<br>
<br>
</div>Yes, auditctl -l will have to be updated. If you want to do that, it would be<br>
helpful. Also, see the comments on the other patch in case it affects this one.<br></blockquote><div><br></div><div>It will and I'll update this.</div><div><br></div><div>This only supports != and = because those were the only two that really seemed like meaningful tests for these fields; do you think this should support <, <=, >, >= as well (I'm assuming that bitmasks wouldn't make sense at all)</div>

<div><br></div><div>Cheers,</div><div>peter</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="HOEnZb"><font color="#888888">
-Steve<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><font face="arial, helvetica, sans-serif">Peter Moody      Google    1.650.253.7306     <br>Security Engineer  pgp:0xC3410038</font><br><br>