Gentoo Archives: gentoo-commits

From: "William Hubbs (williamh)" <williamh@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-lang/go/files: go-1.0.2-hardened.patch
Date: Mon, 30 Jul 2012 18:49:48
Message-Id: 20120730184939.19A142004C@flycatcher.gentoo.org
1 williamh 12/07/30 18:49:39
2
3 Added: go-1.0.2-hardened.patch
4 Log:
5 Add go version 1.0.2 to the tree and sync live ebuild.
6 This also includes a patch from upstream to add the pax flags header to
7 binaries.
8
9 (Portage version: 2.2.0_alpha120/cvs/Linux i686)
10
11 Revision Changes Path
12 1.1 dev-lang/go/files/go-1.0.2-hardened.patch
13
14 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/go/files/go-1.0.2-hardened.patch?rev=1.1&view=markup
15 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/go/files/go-1.0.2-hardened.patch?rev=1.1&content-type=text/plain
16
17 Index: go-1.0.2-hardened.patch
18 ===================================================================
19 Index: src/cmd/6l/asm.c
20 ===================================================================
21 --- a/src/cmd/6l/asm.c
22 +++ b/src/cmd/6l/asm.c
23 @@ -1082,6 +1082,11 @@
24 ph->type = PT_GNU_STACK;
25 ph->flags = PF_W+PF_R;
26 ph->align = 8;
27 +
28 + ph = newElfPhdr();
29 + ph->type = PT_PAX_FLAGS;
30 + ph->flags = 0x2a00; // mprotect, randexec, emutramp disabled
31 + ph->align = 8;
32
33 sh = newElfShstrtab(elfstr[ElfStrShstrtab]);
34 sh->type = SHT_STRTAB;
35 Index: src/cmd/8l/asm.c
36 ===================================================================
37 --- a/src/cmd/8l/asm.c
38 +++ b/src/cmd/8l/asm.c
39 @@ -1127,6 +1127,11 @@
40 ph->flags = PF_W+PF_R;
41 ph->align = 4;
42
43 + ph = newElfPhdr();
44 + ph->type = PT_PAX_FLAGS;
45 + ph->flags = 0x2a00; // mprotect, randexec, emutramp disabled
46 + ph->align = 8;
47 +
48 sh = newElfShstrtab(elfstr[ElfStrShstrtab]);
49 sh->type = SHT_STRTAB;
50 sh->addralign = 1;
51 Index: src/cmd/ld/elf.h
52 ===================================================================
53 --- a/src/cmd/ld/elf.h
54 +++ b/src/cmd/ld/elf.h
55 @@ -251,6 +251,7 @@
56 #define PT_LOPROC 0x70000000 /* First processor-specific type. */
57 #define PT_HIPROC 0x7fffffff /* Last processor-specific type. */
58 #define PT_GNU_STACK 0x6474e551
59 +#define PT_PAX_FLAGS 0x65041580
60
61 /* Values for p_flags. */
62 #define PF_X 0x1 /* Executable. */