Red Hat Bugzilla – Bug 838551
syscall() truncates return value to 32 bits
Last modified: 2012-09-20 16:39:03 EDT
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:
Author: Oleg Nesterov <email@example.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.
perl 5.14.2 and 5.16.1 are affected.
perl-5.16.1-230.fc18 has been submitted as an update for Fedora 18.
perl-5.14.2-214.fc17 has been submitted as an update for Fedora 17.
perl-5.14.2-200.fc16 has been submitted as an update for Fedora 16.
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing perl-5.16.1-230.fc18'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).
perl-5.16.1-231.fc18 has been submitted as an update for Fedora 18.
perl-5.14.2-215.fc17 has been submitted as an update for Fedora 17.
perl-5.14.2-201.fc16 has been submitted as an update for Fedora 16.
perl-5.16.1-231.fc18 has been pushed to the Fedora 18 stable repository. If problems still persist, please make note of it in this bug report.