Bug 501321

Summary: Removal of directory doesn't produce audit record if rule is recursive
Product: Red Hat Enterprise Linux 5 Reporter: Steve Grubb <sgrubb>
Component: kernelAssignee: Alexander Viro <aviro>
Status: CLOSED ERRATA QA Contact: Red Hat Kernel QE team <kernel-qe>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 5.3CC: dhoward, dzickus, emcnabb, iboverma, jpirko, jplans
Target Milestone: rcKeywords: ZStream
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-02 08:03:29 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 507561    

Description Steve Grubb 2009-05-18 14:44:59 UTC
Description of problem
When you have a recursive audit rule watching a directory and its subtree and you remove the directory, you only get an audit event saying the rule is removed and not one on the directory itself. There should be 2 audit events: one on the directory and one saying the rule was removed.

How reproducible:
Always

Steps to Reproduce:
1. mkdir /tmp/test
2. auditctl -a always,exit -F dir=/tmp/test -F key=test
3. rmdir /tmp/test
4. ausearch --start recent -k test
  
Actual results:
time->Mon May 18 10:42:26 2009
type=CONFIG_CHANGE msg=audit(1242657746.295:37): auid=4325 ses=1 subj=unconfined_u:unconfined_r:auditctl_t:s0 op=add rule key="test2" list=4 res=1
----
time->Mon May 18 10:42:33 2009
type=CONFIG_CHANGE msg=audit(1242657753.089:38): op=remove rule dir="/tmp/test" key="test2" list=4 res=1


Expected results:
One more event that contains at least a syscall and path record.

Comment 2 Alexander Viro 2009-05-18 15:37:25 UTC
Patch posted

Comment 3 RHEL Program Management 2009-05-18 17:49:29 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 4 Don Zickus 2009-05-21 15:37:18 UTC
in kernel-2.6.18-150.el5
You can download this test kernel from http://people.redhat.com/dzickus/el5

Please do NOT transition this bugzilla state to VERIFIED until our QE team
has sent specific instructions indicating when to do so.  However feel free
to provide a comment indicating that this fix has been verified.

Comment 11 errata-xmlrpc 2009-09-02 08:03:29 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2009-1243.html