[perl/f18] Do not truncate syscall() return value to 32 bits
Petr Pisar
ppisar at fedoraproject.org
Tue Sep 11 13:00:57 UTC 2012
commit 4fd537fbb6320638d616625efc70bed10679e5b0
Author: Petr Písař <ppisar at redhat.com>
Date: Tue Sep 11 10:51:23 2012 +0200
Do not truncate syscall() return value to 32 bits
...-pp_syscall-I32-retval-truncates-the-retu.patch | 32 ++++++++++++++++++++
perl.spec | 6 ++++
2 files changed, 38 insertions(+), 0 deletions(-)
---
diff --git a/perl-5.16.1-perl-113980-pp_syscall-I32-retval-truncates-the-retu.patch b/perl-5.16.1-perl-113980-pp_syscall-I32-retval-truncates-the-retu.patch
new file mode 100644
index 0000000..93907a3
--- /dev/null
+++ b/perl-5.16.1-perl-113980-pp_syscall-I32-retval-truncates-the-retu.patch
@@ -0,0 +1,32 @@
+From f9344c91a4ca48288bba30dc94a2d712d0659670 Mon Sep 17 00:00:00 2001
+From: Oleg Nesterov <oleg at redhat.com>
+Date: Wed, 4 Jul 2012 08:21:15 -0700
+Subject: [PATCH] [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.
+---
+ pp_sys.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/pp_sys.c b/pp_sys.c
+index fb93732..c5d63ac 100644
+--- a/pp_sys.c
++++ b/pp_sys.c
+@@ -5456,7 +5456,7 @@ PP(pp_syscall)
+ register I32 items = SP - MARK;
+ unsigned long a[20];
+ register I32 i = 0;
+- I32 retval = -1;
++ IV retval = -1;
+
+ if (PL_tainting) {
+ while (++MARK <= SP) {
+--
+1.7.11.4
+
diff --git a/perl.spec b/perl.spec
index d5fd5fa..204ff5e 100644
--- a/perl.spec
+++ b/perl.spec
@@ -93,6 +93,9 @@ Patch12: perl-5.16.1-PATCH-perl-114220-h-not-equiv-to-h.patch
# Clear $@ before `do' I/O error, rhbz#834226, RT#113730
Patch13: perl-5.16.1-RT-113730-should-be-cleared-on-do-IO-error.patch
+# Do not truncate syscall() return value to 32 bits, rhbz#838551, RT#113980
+Patch14: perl-5.16.1-perl-113980-pp_syscall-I32-retval-truncates-the-retu.patch
+
# Update some of the bundled modules
# see http://fedoraproject.org/wiki/Perl/perl.spec for instructions
@@ -1313,6 +1316,7 @@ tarball from perl.org.
%patch11 -p1
%patch12 -p1
%patch13 -p1
+%patch14 -p1
#copy the example script
cp -a %{SOURCE5} .
@@ -1518,6 +1522,7 @@ pushd %{build_archlib}/CORE/
'Fedora Patch11: Do not access freed memory when cloning thread (RT#111610)' \
'Fedora Patch12: Match non-breakable space with /[\h]/ in ASCII mode (RT#114220)' \
'Fedora Patch13: Clear $@ before "do" I/O error (RT#113730)' \
+ 'Fedora Patch14: Do not truncate syscall() return value to 32 bits (RT#113980)' \
%{nil}
rm patchlevel.bak
@@ -2591,6 +2596,7 @@ sed \
- Do not access freed memory when cloning thread (bug #825749)
- Match non-breakable space with /[\h]/ in ASCII mode (bug #844919)
- Clear $@ before `do' I/O error (bug #834226)
+- Do not truncate syscall() return value to 32 bits (bug #838551)
* Wed Sep 05 2012 Petr Pisar <ppisar at redhat.com> - 4:5.16.1-229
- Remove perl-devel dependency from perl-Test-Harness and perl-Test-Simple
More information about the scm-commits
mailing list