[perl/f16] Do not truncate syscall() return value to 32 bits

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



commit d49c6d2816062f2b4282b8c83ba0c67b5ca8131a
Author: Petr Písař <ppisar@xxxxxxxxxx>
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@xxxxxxxxxx>
+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 c4ab6c2..63b97a4 100644
--- a/perl.spec
+++ b/perl.spec
@@ -99,6 +99,9 @@ Patch16:        perl-5.14.2-find2perl-transtate-question-mark-properly.patch
 # Clear $@ before `do' I/O error, rhbz#834226, RT#113730
 Patch17:        perl-5.14.2-RT-113730-should-be-cleared-on-do-IO-error.patch
 
+# Do not truncate syscall() return value to 32 bits, rhbz#838551, RT#113980
+Patch18:        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
 
@@ -1148,6 +1151,7 @@ tarball from perl.org.
 %patch15 -p1
 %patch16 -p1
 %patch17 -p1
+%patch18 -p1
 
 #copy the example script
 cp -a %{SOURCE5} .
@@ -1346,6 +1350,7 @@ pushd %{build_archlib}/CORE/
     'Fedora Patch15: Stop !$^V from leaking' \
     'Fedora Patch16: Fix find2perl to translate ? glob properly (RT#113054)' \
     'Fedora Patch17: Clear $@ before "do" I/O error (RT#113730)' \
+    'Fedora Patch18: Do not truncate syscall() return value to 32 bits (RT#113980)' \
     %{nil}
 
 rm patchlevel.bak
@@ -2237,6 +2242,7 @@ sed \
 %changelog
 * Tue Sep 11 2012 Petr Pisar <ppisar@xxxxxxxxxx> - 4:5.14.2-200
 - 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@xxxxxxxxxx> - 4:5.14.2-199
 - Remove perl-devel dependency from perl-Test-Harness and perl-Test-Simple
--
Fedora Extras Perl SIG
http://www.fedoraproject.org/wiki/Extras/SIGs/Perl
perl-devel mailing list
perl-devel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/perl-devel



[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Legacy Announce]     [Fedora PHP Devel]     [Kernel Devel]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Big List of Linux Books]     [Gimp]     [Yosemite Information]
  Powered by Linux