Bug 239887

Summary: LSPP: watches using -p omit some syscalls
Product: Red Hat Enterprise Linux 5 Reporter: Linda Knippers <linda.knippers>
Component: kernelAssignee: Eric Paris <eparis>
Status: CLOSED ERRATA QA Contact: Martin Jenner <mjenner>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.0CC: amy.griffis, eparis, iboverma, krisw, kweidner, poelstra, sgrubb
Target Milestone: ---Keywords: OtherQA
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2007-0959 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-11-07 19:49:14 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: 224041    
Attachments:
Description Flags
proposed patch for syscall match check none

Description Linda Knippers 2007-05-11 21:52:00 UTC
Description of problem:
When I add an audit watch on a file with no arguments, I get perm=rwxa
but on ia64, changes to the mode and context aren't audited.  I
get audit records on i386 and x86_64.

Version-Release number of selected component (if applicable):
I'm running the .80 LSPP kernel

How reproducible:
very

Steps to Reproduce:
1. touch foo
2. auditctl -w `pwd`/foo
3. chmod 666 foo
4. chcon -l Secret foo
  
Actual results:
On ia64, I only see an audit record for adding the watch, not for
the chmod or the chcon.  

Expected results:
Should see audit records for the chmod and chcon.

Additional info:
I see the expected audit records on i386 and x86_64 systems.

Comment 1 Klaus Weidner 2007-05-11 22:14:21 UTC
Created attachment 154573 [details]
proposed patch for syscall match check

The check is wrong, AUDIT_BITMASK_SIZE is 64, providing space for 2048 syscalls
in 64 * 32bit integers. The comparison only supports 256 syscalls, and silently
returns "no match" for valid higher-numbered syscalls.

This breaks class-based audit for all syscalls on ia64 since on that
architecture syscall numbers start at 1024. 

It breaks some syscall audit on other architectures also, for example
__NR_fchmodat is 306 on x86.

I'd suggest adding a printk() in addition to returning 0 - you don't want to
silently ignore unknown or unsupported syscalls when auditing.

Comment 2 Linda Knippers 2007-05-11 23:17:02 UTC
I gave Klaus's patch a quick test on ia64 and it solves the problem I was
seeing.  Thanks Klaus!

Comment 3 Steve Grubb 2007-05-14 14:14:57 UTC
The patch should be sent to linux-audit mail list for review and pushing upstream.

Comment 5 RHEL Program Management 2007-06-04 21:21:51 UTC
This request was evaluated by Red Hat Kernel Team for inclusion in a Red
Hat Enterprise Linux maintenance release, and has moved to bugzilla 
status POST.

Comment 6 Don Zickus 2007-06-16 00:31:05 UTC
in 2.6.18-27.el5
You can download this test kernel from http://people.redhat.com/dzickus/el5

Comment 8 John Poelstra 2007-08-14 19:46:23 UTC
A fix for this issue has been included in the packages contained in the beta
(RHN channel) or most recent snapshot (partners.redhat.com) for RHEL5.1.  Please
verify that your issue is fixed.

After you (Red Hat Partner) have verified that this issue has been addressed,
please perform the following:
1) Change the *status* of this bug to VERIFIED.
2) Add *keyword* of PartnerVerified (leaving the existing keywords unmodified)

If this issue is not fixed, please add a comment describing the most recent
symptoms of the problem you are having and change the status of the bug to ASSIGNED.

Comment 9 Linda Knippers 2007-08-15 15:14:27 UTC
This problem appears to be fixed in the RHEL5 U1 Beta.  In verifying
the fix I noticed that ausearch is getting a segfault on my system.
If I don't find an existing bz I'll open a new one for that.

Comment 10 Steve Grubb 2007-08-15 15:18:56 UTC
Linda, audit packages before 1.5.5-5 are known to segfault on acct fields and
there is already a bz for that. Please check that you are testing with snap 1
audit package 1.5.5-5. Thanks.

Comment 11 Linda Knippers 2007-08-15 15:24:38 UTC
Steve, thanks for the info.  I'm running 1.5.5-4 so I'll try later on
a snap1 system.  



Comment 15 errata-xmlrpc 2007-11-07 19:49:14 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 the 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/RHBA-2007-0959.html