Bug 453394

Summary: [RHEL5.2]: Running strace with a bad syscall doesn't return -ENOSYS
Product: Red Hat Enterprise Linux 5 Reporter: Chris Lalancette <clalance>
Component: kernel-xenAssignee: Chris Lalancette <clalance>
Status: CLOSED ERRATA QA Contact: Martin Jenner <mjenner>
Severity: low Docs Contact:
Priority: urgent    
Version: 5.2CC: andreas.bierfert, dmair, orion, xen-maint
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-01-20 19:35:15 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: 449772, 470853    

Description Chris Lalancette 2008-06-30 11:18:42 UTC
Description of problem:
If you take the following program:

#include <stdio.h>
#include <stdlib.h>
#include <sys/syscall.h>
#include <sys/types.h>

int main()
{
        int foo;

        foo = syscall(289);

        fprintf(stderr, "Error is %d\n",foo);

        return 0;
}

and compile and run it on the RHEL 5.2 xen kernel, you will get -1 as the output
from the syscall, since 289 is not a valid syscall in RHEL-5.  Now, if you take
that same program and run it under strace, you will get a return value of 289,
which is wrong.  This is because of a minor bug in
arch/x86_64/kernel/entry-xen.S, where if we are tracing the syscall, we copy
that syscall number into the return instead of the appropriate -ENOSYS.  This
bug is also present in the upstream Xen 2.6.18 kernel, but is fixed in the
upstream Linux kernel.

Comment 1 Chris Lalancette 2008-06-30 11:44:30 UTC
Oh, I should mention that this came out of the discussion of BZ 442352, although
I do not believe it is the root cause of that issue.

Chris Lalancette

Comment 2 RHEL Program Management 2008-06-30 11:57:31 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 2008-07-18 20:07:50 UTC
in kernel-2.6.18-98.el5
You can download this test kernel from http://people.redhat.com/dzickus/el5

Comment 5 Chris Lalancette 2008-08-28 18:59:19 UTC
*** Bug 459442 has been marked as a duplicate of this bug. ***

Comment 9 Orion Poplawski 2008-09-08 14:24:38 UTC
*** Bug 461349 has been marked as a duplicate of this bug. ***

Comment 16 errata-xmlrpc 2009-01-20 19:35:15 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-0225.html