<div class="socmaildefaultfont" dir="ltr" style="font-family:Arial, Helvetica, sans-serif;font-size:10.5pt" ><div dir="ltr" >Hi,<br> </div>
<div dir="ltr" >Here is my general question. I have not found an answer in the auditd docs.</div>
<div dir="ltr" > </div>
<div dir="ltr" >auditd records timestamps. What time do these timestamps represent?</div>
<div dir="ltr" >- After syscall is issued but before any action begins in kernel-space?</div>
<div dir="ltr" >- During syscall?</div>
<div dir="ltr" >- After syscall completes but before it returns to userspace?</div>
<div dir="ltr" >- "Asynchronously"?</div>
<div dir="ltr" >- Other?</div>
<div dir="ltr" > </div>
<div dir="ltr" ><div>I was expecting the answer to be "Sometime during the kernel-space execution of the syscall".</div>
<div>I was surprised this morning to find that this does not appear to be the case.</div>
<div> </div></div>
<div dir="ltr" >Here is an example:</div>
<div dir="ltr" > </div>
<div dir="ltr" >1. I configure auditd to watch the exit_group syscall.</div>
<div dir="ltr" > </div>
<div dir="ltr" ># auditctl -l<br>-a always,exit -F arch=b32 -S exit,fork,execve,setpgid,clone,exit_group -F key=foo<br>-a always,exit -F arch=b64 -S clone,fork,execve,exit,setpgid,exit_group -F key=foo</div>
<div dir="ltr" > </div>
<div dir="ltr" >2. I strace a dd process, watching its syscalls to see when it issues exit_group.</div>
<div dir="ltr" > </div>
<div dir="ltr" ># strace -tt dd if=/dev/zero of=/fs1/timestampTest bs=1K count=1 2>&1 | egrep 'exit'<br>09:28:<strong>42.829</strong>212 exit_group(0)           = ?<br>09:28:<strong>42.829</strong>278 +++ exited with 0 +++</div>
<div dir="ltr" > </div>
<div dir="ltr" >strace records that the dd process calls exit_group at <strong>42.829</strong>.</div>
<div dir="ltr" > </div>
<div dir="ltr" >3. auditd records a slightly different time -- one millisecond off.</div>
<div dir="ltr" > </div>
<div dir="ltr" >I found the pid of the strace process and found where it clones the dd process.</div>
<div dir="ltr" >The dd process had pid 16642.</div>
<div dir="ltr" >Let's see what auditd has to say about pid 16642.</div>
<div dir="ltr" > </div>
<div dir="ltr" ><div>[root@fin13p 09:49:08 ~] # ausearch --pid 16642 --interpret --start '09:00:00'<br>----<br>type=PATH msg=audit(08/01/2018 09:28:42.823:84286412) : item=1 name=/lib64/ld-linux-x86-64.so.2 inode=403084422 dev=fd:00 mode=file,755 ouid=root ogid=root rdev=00:00 objtype=NORMAL<br>type=PATH msg=audit(08/01/2018 09:28:42.823:84286412) : item=0 name=/bin/dd inode=269218970 dev=fd:00 mode=file,755 ouid=root ogid=root rdev=00:00 objtype=NORMAL<br>type=CWD msg=audit(08/01/2018 09:28:42.823:84286412) :  cwd=/ghome/jamiedavis/src<br>type=EXECVE msg=audit(08/01/2018 09:28:42.823:84286412) : <strong>argc=5 a0=dd a1=if=/dev/zero a2=of=/fs1/timestampTest a3=bs=1K a4=count=1</strong><br>type=SYSCALL msg=audit(08/01/2018 09:28:42.823:84286412) : arch=x86_64 syscall=execve success=yes exit=0 a0=0x7ffe5a2db320 a1=0x7ffe5a2dc6a8 a2=0x7ffe5a2dc6d8 a3=0x7ffe5a2dae20 items=2 ppid=16639 <strong>pid=16642 </strong>auid=root uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=pts6 ses=6437 comm=dd exe=/usr/bin/dd key=prov-auditd<br>----<br>type=SYSCALL msg=audit(08/01/2018 09:28:<strong>42.828</strong>:84286414) : arch=x86_64 syscall=<strong>exit_group</strong> a0=EXIT_SUCCESS a1=0x0 a2=0x0 a3=0xffffffffffffff70 items=0 ppid=16639 pid=16642 auid=root uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=pts6 ses=6437 comm=dd exe=/usr/bin/dd key=prov-auditd</div>
<div> </div>
<div>----------</div>
<div> </div>
<div>Here is my specific question: Why does strace say that exit_group was called at 42.829 while auditd says that the time was 42.828?</div>
<div> </div></div>
<div dir="ltr" >Thanks,</div>
<div dir="ltr" > </div>
<div dir="ltr" >Jamie</div></div><BR>