From 4c52516d71e835501898553feb64f1abacef943d Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 23 Apr 2015 14:41:34 +0100 Subject: [PATCH] ppc, ppc64, ppc64le: Properly mark stack as non-executable. The upstream fix was not applied completely. --- ...ore-.-configure-it-s-a-real-git-file.patch | 2 +- ...pilerlibs-directory-is-created-by-gi.patch | 2 +- 0003-Don-t-add-rpaths-to-libraries.patch | 2 +- ...amlplugininfo-Useful-utilities-from-.patch | 2 +- ...-Allow-user-defined-C-compiler-flags.patch | 2 +- 0006-Add-support-for-ppc64.patch | 2 +- 0007-ppc64-Update-for-OCaml-4.02.0.patch | 2 +- 0008-Add-support-for-ppc64le.patch | 2 +- 0009-ppc64le-Update-for-OCaml-4.02.0.patch | 2 +- ...m-arm64-Mark-stack-as-non-executable.patch | 2 +- ...-no_arg-and-get_arg-helper-functions.patch | 2 +- ...such-as-flag-arg-as-well-as-flag-arg.patch | 2 +- ...C99-types-u-int-32-64-_t-in-preferen.patch | 2 +- ...ppc64le-Mark-stack-as-non-executable.patch | 46 +++++++++++++++++-- ...oc-Interim-definitions-for-op_is_pur.patch | 4 +- ocaml.spec | 6 ++- 16 files changed, 61 insertions(+), 21 deletions(-) diff --git a/0001-Don-t-ignore-.-configure-it-s-a-real-git-file.patch b/0001-Don-t-ignore-.-configure-it-s-a-real-git-file.patch index fc24a1d..34ee8c9 100644 --- a/0001-Don-t-ignore-.-configure-it-s-a-real-git-file.patch +++ b/0001-Don-t-ignore-.-configure-it-s-a-real-git-file.patch @@ -20,5 +20,5 @@ index 6c66ecc..5d4b626 100644 /ocamlc.opt /expunge -- -2.1.0 +2.3.1 diff --git a/0002-Ensure-empty-compilerlibs-directory-is-created-by-gi.patch b/0002-Ensure-empty-compilerlibs-directory-is-created-by-gi.patch index 49f1eac..2eb6fc4 100644 --- a/0002-Ensure-empty-compilerlibs-directory-is-created-by-gi.patch +++ b/0002-Ensure-empty-compilerlibs-directory-is-created-by-gi.patch @@ -14,5 +14,5 @@ diff --git a/compilerlibs/.exists b/compilerlibs/.exists new file mode 100644 index 0000000..e69de29 -- -2.1.0 +2.3.1 diff --git a/0003-Don-t-add-rpaths-to-libraries.patch b/0003-Don-t-add-rpaths-to-libraries.patch index 98f7bfd..2f3aff0 100644 --- a/0003-Don-t-add-rpaths-to-libraries.patch +++ b/0003-Don-t-add-rpaths-to-libraries.patch @@ -25,5 +25,5 @@ index 2517434..75a75b4 100644 sed -n -e 's/^#ml //p' ../config/Makefile) \ > ocamlmklibconfig.ml -- -2.1.0 +2.3.1 diff --git a/0004-ocamlbyteinfo-ocamlplugininfo-Useful-utilities-from-.patch b/0004-ocamlbyteinfo-ocamlplugininfo-Useful-utilities-from-.patch index 5bd3701..55b401c 100644 --- a/0004-ocamlbyteinfo-ocamlplugininfo-Useful-utilities-from-.patch +++ b/0004-ocamlbyteinfo-ocamlplugininfo-Useful-utilities-from-.patch @@ -236,5 +236,5 @@ index 0000000..e28800f + header.units + end -- -2.1.0 +2.3.1 diff --git a/0005-configure-Allow-user-defined-C-compiler-flags.patch b/0005-configure-Allow-user-defined-C-compiler-flags.patch index 2fa0cf5..6d4f4de 100644 --- a/0005-configure-Allow-user-defined-C-compiler-flags.patch +++ b/0005-configure-Allow-user-defined-C-compiler-flags.patch @@ -23,5 +23,5 @@ index 3edb9fd..18b95cd 100755 cclibs="$cclibs $mathlib" -- -2.1.0 +2.3.1 diff --git a/0006-Add-support-for-ppc64.patch b/0006-Add-support-for-ppc64.patch index 656d4e7..b1120fb 100644 --- a/0006-Add-support-for-ppc64.patch +++ b/0006-Add-support-for-ppc64.patch @@ -2126,5 +2126,5 @@ index 18b95cd..57c8699 100755 aspp="$bytecc -c";; sparc,solaris) as="${TOOLPREF}as" -- -2.1.0 +2.3.1 diff --git a/0007-ppc64-Update-for-OCaml-4.02.0.patch b/0007-ppc64-Update-for-OCaml-4.02.0.patch index 9908c74..3fc6a66 100644 --- a/0007-ppc64-Update-for-OCaml-4.02.0.patch +++ b/0007-ppc64-Update-for-OCaml-4.02.0.patch @@ -201,5 +201,5 @@ index b7bba9b..b582b6a 100644 | Iintop(Imod) -> 40 (* assuming full stall *) | Iintop(Icomp _) -> 4 -- -2.1.0 +2.3.1 diff --git a/0008-Add-support-for-ppc64le.patch b/0008-Add-support-for-ppc64le.patch index ac4e636..e3bc207 100644 --- a/0008-Add-support-for-ppc64le.patch +++ b/0008-Add-support-for-ppc64le.patch @@ -1913,5 +1913,5 @@ index 57c8699..c04272c 100755 aspp="$bytecc -c";; sparc,solaris) as="${TOOLPREF}as" -- -2.1.0 +2.3.1 diff --git a/0009-ppc64le-Update-for-OCaml-4.02.0.patch b/0009-ppc64le-Update-for-OCaml-4.02.0.patch index 083bfdd..c27fff2 100644 --- a/0009-ppc64le-Update-for-OCaml-4.02.0.patch +++ b/0009-ppc64le-Update-for-OCaml-4.02.0.patch @@ -200,5 +200,5 @@ index b7bba9b..b582b6a 100644 | Iintop(Imod) -> 40 (* assuming full stall *) | Iintop(Icomp _) -> 4 -- -2.1.0 +2.3.1 diff --git a/0010-arm-arm64-Mark-stack-as-non-executable.patch b/0010-arm-arm64-Mark-stack-as-non-executable.patch index 572ffac..b244c4f 100644 --- a/0010-arm-arm64-Mark-stack-as-non-executable.patch +++ b/0010-arm-arm64-Mark-stack-as-non-executable.patch @@ -35,5 +35,5 @@ index 9b4b9ab..c23168b 100644 + /* Mark stack as non-executable, PR#4564 */ + .section .note.GNU-stack,"",%progbits -- -2.1.0 +2.3.1 diff --git a/0011-arg-Add-no_arg-and-get_arg-helper-functions.patch b/0011-arg-Add-no_arg-and-get_arg-helper-functions.patch index f21c0d2..992e143 100644 --- a/0011-arg-Add-no_arg-and-get_arg-helper-functions.patch +++ b/0011-arg-Add-no_arg-and-get_arg-helper-functions.patch @@ -114,5 +114,5 @@ index d7b8ac0..a8f3964 100644 treat_action action with Bad m -> stop (Message m); -- -2.1.0 +2.3.1 diff --git a/0012-arg-Allow-flags-such-as-flag-arg-as-well-as-flag-arg.patch b/0012-arg-Allow-flags-such-as-flag-arg-as-well-as-flag-arg.patch index f319666..2fd8acc 100644 --- a/0012-arg-Allow-flags-such-as-flag-arg-as-well-as-flag-arg.patch +++ b/0012-arg-Allow-flags-such-as-flag-arg-as-well-as-flag-arg.patch @@ -80,5 +80,5 @@ index 0999edf..71af638 100644 Examples ([cmd] is assumed to be the command name): -- -2.1.0 +2.3.1 diff --git a/0013-PR-6517-use-ISO-C99-types-u-int-32-64-_t-in-preferen.patch b/0013-PR-6517-use-ISO-C99-types-u-int-32-64-_t-in-preferen.patch index 7d5f445..add1524 100644 --- a/0013-PR-6517-use-ISO-C99-types-u-int-32-64-_t-in-preferen.patch +++ b/0013-PR-6517-use-ISO-C99-types-u-int-32-64-_t-in-preferen.patch @@ -1959,5 +1959,5 @@ index cb3d995..93cdfeb 100644 lseek(fd, (long) -TRAILER_SIZE, SEEK_END); -- -2.1.0 +2.3.1 diff --git a/0014-ppc-ppc64-ppc64le-Mark-stack-as-non-executable.patch b/0014-ppc-ppc64-ppc64le-Mark-stack-as-non-executable.patch index e420f1b..9afde99 100644 --- a/0014-ppc-ppc64-ppc64le-Mark-stack-as-non-executable.patch +++ b/0014-ppc-ppc64-ppc64le-Mark-stack-as-non-executable.patch @@ -1,4 +1,4 @@ -From 074d0a2b85a7d4f505846ac629b28a3a8894ebbc Mon Sep 17 00:00:00 2001 +From 8e493f90181b8b592185b2f9322575113b5ff7d5 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 11 Sep 2014 14:49:54 +0100 Subject: [PATCH 14/15] ppc, ppc64, ppc64le: Mark stack as non-executable. @@ -8,10 +8,46 @@ i686 & x86-64: http://caml.inria.fr/mantis/view.php?id=4564 --- - asmrun/power-elf.S | 3 +++ - asmrun/power64-elf.S | 2 ++ - 2 files changed, 5 insertions(+) + asmcomp/power/emit.mlp | 3 ++- + asmcomp/power64/emit.mlp | 3 ++- + asmcomp/power64le/emit.mlp | 3 ++- + asmrun/power-elf.S | 3 +++ + asmrun/power64-elf.S | 2 ++ + 5 files changed, 11 insertions(+), 3 deletions(-) +diff --git a/asmcomp/power/emit.mlp b/asmcomp/power/emit.mlp +index 0a26ed1..8e31b58 100644 +--- a/asmcomp/power/emit.mlp ++++ b/asmcomp/power/emit.mlp +@@ -963,4 +963,5 @@ let end_assembly() = + ` .long ({emit_label lbl} - .) + {emit_int32 ofs}\n`); + efa_def_label = (fun l -> `{emit_label l}:\n`); + efa_string = (fun s -> emit_bytes_directive " .byte " (s ^ "\000")) +- } ++ }; ++ `.section .note.GNU-stack,\"\",%progbits; .previous\n` +diff --git a/asmcomp/power64/emit.mlp b/asmcomp/power64/emit.mlp +index 9fd59b2..4e0317a 100644 +--- a/asmcomp/power64/emit.mlp ++++ b/asmcomp/power64/emit.mlp +@@ -990,4 +990,5 @@ let end_assembly() = + `{emit_symbol lbl}:\n`; + ` .quad {emit_int (List.length !frame_descriptors)}\n`; + List.iter emit_frame !frame_descriptors; +- frame_descriptors := [] ++ frame_descriptors := []; ++ `.section .note.GNU-stack,\"\",%progbits; .previous\n` +diff --git a/asmcomp/power64le/emit.mlp b/asmcomp/power64le/emit.mlp +index 3f34102..60df72c 100644 +--- a/asmcomp/power64le/emit.mlp ++++ b/asmcomp/power64le/emit.mlp +@@ -983,4 +983,5 @@ let end_assembly() = + `{emit_symbol lbl}:\n`; + ` .quad {emit_int (List.length !frame_descriptors)}\n`; + List.iter emit_frame !frame_descriptors; +- frame_descriptors := [] ++ frame_descriptors := []; ++ `.section .note.GNU-stack,\"\",%progbits; .previous\n` diff --git a/asmrun/power-elf.S b/asmrun/power-elf.S index facbfbf..14d28a0 100644 --- a/asmrun/power-elf.S @@ -34,5 +70,5 @@ index 98c42e2..b7bfce4 100644 +/* Mark stack as non-executable, PR#4564 */ + .section .note.GNU-stack,"",%progbits -- -2.1.0 +2.3.1 diff --git a/0015-ppc64-ppc64le-proc-Interim-definitions-for-op_is_pur.patch b/0015-ppc64-ppc64le-proc-Interim-definitions-for-op_is_pur.patch index 3f72e62..fc6db17 100644 --- a/0015-ppc64-ppc64le-proc-Interim-definitions-for-op_is_pur.patch +++ b/0015-ppc64-ppc64le-proc-Interim-definitions-for-op_is_pur.patch @@ -1,4 +1,4 @@ -From 632c63206ec47f67af0027b5c0d173784e510c08 Mon Sep 17 00:00:00 2001 +From df5201a35d02a13ad7ffd6fb38252851910cae43 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 24 Oct 2014 10:10:54 +0100 Subject: [PATCH 15/15] ppc64/ppc64le: proc: Interim definitions for op_is_pure @@ -80,5 +80,5 @@ index 476c984..56473ac 100644 let num_stack_slots = [| 0; 0 |] -- -2.1.0 +2.3.1 diff --git a/ocaml.spec b/ocaml.spec index 11aa713..0712f6b 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -17,7 +17,7 @@ Name: ocaml Version: 4.02.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: OCaml compiler and programming environment @@ -421,6 +421,10 @@ fi %changelog +* Thu Apr 23 2015 Richard W.M. Jones - 4.02.1-3 +- ppc, ppc64, ppc64le: Properly mark stack as non-executable. + The upstream fix was not applied completely. + * Thu Feb 26 2015 Richard W.M. Jones - 4.02.1-2 - Kill dependency on rpm-build. Added in 2009, apparently by accident. (Thanks: Jon Ludlam)