Bug 146093 (IT_55591) - incorrect mmap flags with 32-bit binary on x86_64
Summary: incorrect mmap flags with 32-bit binary on x86_64
Status: CLOSED ERRATA
Alias: IT_55591
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: strace (Show other bugs)
(Show other bugs)
Version: 3.0
Hardware: All Linux
medium
medium
Target Milestone: ---
Assignee: Roland McGrath
QA Contact: Brian Brock
URL:
Whiteboard:
Keywords:
Depends On:
Blocks: 132991 146413 154655
TreeView+ depends on / blocked
 
Reported: 2005-01-25 11:20 UTC by Bastien Nocera
Modified: 2007-11-30 22:07 UTC (History)
1 user (show)

Fixed In Version: RHBA-2005-130
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-05-19 21:10:05 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2005:130 normal SHIPPED_LIVE strace bug fix update 2005-06-09 04:00:00 UTC
Red Hat Product Errata RHBA-2005:131 normal SHIPPED_LIVE strace bug fix update 2005-05-19 04:00:00 UTC

Description Bastien Nocera 2005-01-25 11:20:44 UTC
Testcase:
#include <stdio.h>
int main(void)
{
        FILE *f;
        char a[100];
        char *b;
        f=fopen("abc","r");
        b=fgets(a,3,f);
        printf("b=%p\n",b);
}

On x86_64, with a 64-bit testcase (last mmap call):
<snip>
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x2a9566e000
<snip>

On x86_64, with a 32-bit testcase (last mmap call):
<snip>
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, 0x3 /* MAP_??? */, 34,
0xffffffff) = 0x40017000
<snip>

0x3 would mean that the flags are MAP_SHARED|MAP_PRIVATE, and the file
descriptor is obviously wrong.

Comment 2 Roland McGrath 2005-02-02 03:19:05 UTC
I have fixed this upstream.  In fact, the bug was giving bad values
for the third and later arguments to all 32-bit syscalls on x86_64.
That bug was in the original x86_64 support for strace contributed
upstream by others.

Comment 9 Tim Powers 2005-05-19 21:10:05 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-2005-131.html



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