Bug 234426 - LSPP: Interrupted syscalls do not have the correct errno value in the audit log
Summary: LSPP: Interrupted syscalls do not have the correct errno value in the audit log
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel
Version: 5.0
Hardware: All
OS: Linux
medium
low
Target Milestone: ---
: ---
Assignee: Eric Paris
QA Contact: Martin Jenner
URL:
Whiteboard:
Depends On:
Blocks: 425461
TreeView+ depends on / blocked
 
Reported: 2007-03-29 05:31 UTC by Paul Moore
Modified: 2008-05-21 14:42 UTC (History)
5 users (show)

Fixed In Version: RHBA-2008-0314
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-05-21 14:42:14 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Simple test case (2.27 KB, text/x-csrc)
2007-05-07 14:31 UTC, Paul Moore
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2008:0314 0 normal SHIPPED_LIVE Updated kernel packages for Red Hat Enterprise Linux 5.2 2008-05-20 18:43:34 UTC

Description Paul Moore 2007-03-29 05:31:07 UTC
Description of problem:
If a syscall is interrupted by a signal the errno value recorded in the audit 
log is -512 (-ERESTARTSYS) which is a private, kernel-only errno value and 
does not reflect what is seen in userspace, 4 (EINTR).  I would expect that 
the errno value recorded in the audit log should match what is seen in 
userspace.

Version-Release number of selected component (if applicable):
RHEL5 lspp.70 kernel

How reproducible:
Every time, both if syscall is restarted or not

Steps to Reproduce:
1. Run an application which does the following:
   * Installs a signal handler for SIGALRM
   * Disable syscall restarts for SIGALRM
   * Set an alarm for a future time
   * Block in a syscall
2. Check audit logs and notice that the syscall failed with errno=-512
  
Actual results:
The audit log reports an errno of -512 (-ERESTARTSYS).

Expected results:
The audit log reports an errno of -4 (-EINTR).

Additional info:
This bug is *not* blocking the LSPP certification efforts of HP, Red Hat, and 
IBM.

Comment 1 Jay Turner 2007-05-03 19:17:43 UTC
QE ack for RHEL5.1.  Would be good to get a testcase generated and aligned
against this issue.

Comment 2 Paul Moore 2007-05-07 14:31:25 UTC
Created attachment 154267 [details]
Simple test case

As outlined in the original bug description, the test for this is rather
trivial; a crude test case is attached.  Simply compile the testcase, run the
resulting binary, and wait for it to timeout via the self-generated alarm
signal.  Check the audit log and viola, one strange audit record.

Comment 6 RHEL Program Management 2007-11-01 18:25:36 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 7 Eric Paris 2007-11-14 20:23:03 UTC
potential patch sent to linux-audit Nov 14 from Eric Paris

Comment 9 Don Zickus 2008-01-10 20:39:42 UTC
in 2.6.18-66.el5
You can download this test kernel from http://people.redhat.com/dzickus/el5

Comment 11 Mike Gahagan 2008-05-05 20:44:26 UTC
verified using the test case on the -92.el5 kernel.


Comment 13 errata-xmlrpc 2008-05-21 14:42: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-2008-0314.html



Note You need to log in before you can comment on or make changes to this bug.