https://bugzilla.redhat.com/show_bug.cgi?id=838551
Bug ID: 838551
QA Contact: extras-qa(a)fedoraproject.org
Severity: high
URL:
https://rt.perl.org/rt3/Public/Bug/Display.html?id=113
980
Version: 16
Priority: unspecified
CC: cweyl(a)alumni.drew.edu, iarnell(a)gmail.com,
jplesnik(a)redhat.com, kasal(a)ucw.cz, lkundrak(a)v3.sk,
mmaslano(a)redhat.com,
perl-devel(a)lists.fedoraproject.org, ppisar(a)redhat.com,
psabata(a)redhat.com, rc040203(a)freenet.de,
tcallawa(a)redhat.com
Assignee: mmaslano(a)redhat.com
Summary: syscall() truncates return value to 32 bits
Regression: ---
Story Points: ---
Classification: Fedora
OS: Unspecified
Reporter: ppisar(a)redhat.com
Type: Bug
Documentation: ---
Hardware: x86_64
Mount Type: ---
Status: ASSIGNED
Component: perl
Product: Fedora
There is problem when calling generic syscall() function on 64-bit
architectures. The return value is clamped to 32 bits.
Can be reproduced with mmap or mremap syscalls:
#!/usr/bin/perl -w
use strict;
sub find_vdso()
{
open my $maps, '<', '/proc/self/maps' or die;
/^(.*?)-.*\[vdso\]$/ and return hex $1 for <$maps>;
}
my $vdso_addr = find_vdso || die 'not 64-bit linux?';
my $ret = syscall 25, # __NR_mremap
$vdso_addr, # old_addr
1, # old_len
1, # new_len
0, # flags
0; # new_addr (unused)
$ret == $vdso_addr or die "FAILED\n";
Fixed in upstream commit:
commit f9344c91a4ca48288bba30dc94a2d712d0659670
Author: Oleg Nesterov <oleg(a)redhat.com>
Date: Wed Jul 4 08:21:15 2012 -0700
[perl #113980] pp_syscall: "I32 retval" truncates the returned value
I noticed today that syscall(9, ...) (mmap) doesn't work for me.
The problem is obvious, pp_syscall() uses I32 for retval and the
"long" address doesn't fit into "int".
The one-liner below should fix the problem.
--
You are receiving this mail because:
You are on the CC list for the bug.