Bug 146093 - (IT_55591) incorrect mmap flags with 32-bit binary on x86_64
incorrect mmap flags with 32-bit binary on x86_64
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: strace (Show other bugs)
3.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Roland McGrath
Brian Brock
:
Depends On:
Blocks: 132991 146413 154655
  Show dependency treegraph
 
Reported: 2005-01-25 06:20 EST by Bastien Nocera
Modified: 2007-11-30 17:07 EST (History)
1 user (show)

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


Attachments (Terms of Use)

  None (edit)
Description Bastien Nocera 2005-01-25 06:20:44 EST
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-01 22:19:05 EST
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 17:10:05 EDT
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.