Gentoo Archives: gentoo-commits

From: "Mike Frysinger (vapier)" <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo commit in src/patchsets/glibc/2.11: 1020_all_glibc-longjmp-chk-hidden-fortify.patch README.history
Date: Sun, 29 Nov 2009 18:22:49
Message-Id: E1NEoQ3-000487-Fh@stork.gentoo.org
1 vapier 09/11/29 18:22:47
2
3 Modified: README.history
4 Added: 1020_all_glibc-longjmp-chk-hidden-fortify.patch
5 Log:
6 fix fortify references under hardened toolchains #293637
7
8 Revision Changes Path
9 1.8 src/patchsets/glibc/2.11/README.history
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/glibc/2.11/README.history?rev=1.8&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/glibc/2.11/README.history?rev=1.8&content-type=text/plain
13 diff : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/glibc/2.11/README.history?r1=1.7&r2=1.8
14
15 Index: README.history
16 ===================================================================
17 RCS file: /var/cvsroot/gentoo/src/patchsets/glibc/2.11/README.history,v
18 retrieving revision 1.7
19 retrieving revision 1.8
20 diff -u -r1.7 -r1.8
21 --- README.history 21 Nov 2009 06:21:36 -0000 1.7
22 +++ README.history 29 Nov 2009 18:22:47 -0000 1.8
23 @@ -2,6 +2,7 @@
24 - 0040_all_glibc-i586-chk.patch
25 + 0044_all_glibc-2.10-resolv-nameserver-fallback.patch
26 + 0066_all_glibc-2.10-malloc-check-race-crash.patch
27 + + 1020_all_glibc-longjmp-chk-hidden-fortify.patch
28
29 3 09.11.2009
30 + 0077_all_i386-glibc-no-fallocate.patch
31
32
33
34 1.1 src/patchsets/glibc/2.11/1020_all_glibc-longjmp-chk-hidden-fortify.patch
35
36 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/glibc/2.11/1020_all_glibc-longjmp-chk-hidden-fortify.patch?rev=1.1&view=markup
37 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/glibc/2.11/1020_all_glibc-longjmp-chk-hidden-fortify.patch?rev=1.1&content-type=text/plain
38
39 Index: 1020_all_glibc-longjmp-chk-hidden-fortify.patch
40 ===================================================================
41 http://bugs.gentoo.org/293637
42
43 a bunch of ____longjmp_chk files mix PIC and SHARED code under just PIC.
44 use the HIDDEN_JUMPTARGET() function so the right function is called.
45
46 2009-11-27 Mike Frysinger <vapier@g.o>
47
48 * sysdeps/unix/sysv/linux/i386/____longjmp_chk.S (CALL_FAIL):
49 call HIDDEN_JUMPTARGET(__fortify_fail).
50 * sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S (CALL_FAIL):
51 Likewise.
52 * sysdeps/unix/sysv/linux/ia64/____longjmp_chk.S (CALL_FAIL): Delete.
53 (CHECK_RSP): Branch to HIDDEN_JUMPTARGET(__fortify_fail).
54
55 --- a/sysdeps/unix/sysv/linux/i386/____longjmp_chk.S
56 +++ b/sysdeps/unix/sysv/linux/i386/____longjmp_chk.S
57 @@ -33,10 +33,10 @@ longjmp_msg:
58 cfi_register(%ebx,%ecx); \
59 LOAD_PIC_REG (bx); \
60 leal longjmp_msg@GOTOFF(%ebx), %eax; \
61 - call __GI___fortify_fail@PLT
62 + call HIDDEN_JUMPTARGET(__fortify_fail)
63 #else
64 # define CALL_FAIL movl $longjmp_msg, %eax; \
65 - call __fortify_fail
66 + call HIDDEN_JUMPTARGET(__fortify_fail)
67 #endif
68
69
70 --- a/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S
71 +++ b/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S
72 @@ -31,10 +31,10 @@ longjmp_msg:
73
74 #ifdef PIC
75 # define CALL_FAIL leaq longjmp_msg(%rip), %rdi; \
76 - call __GI___fortify_fail
77 + call HIDDEN_JUMPTARGET(__fortify_fail)
78 #else
79 # define CALL_FAIL movq $longjmp_msg, %rdi; \
80 - call __fortify_fail
81 + call HIDDEN_JUMPTARGET(__fortify_fail)
82 #endif
83
84 #define CHECK_RSP(reg) \
85 --- a/sysdeps/unix/sysv/linux/ia64/____longjmp_chk.S
86 +++ b/sysdeps/unix/sysv/linux/ia64/____longjmp_chk.S
87 @@ -30,19 +30,13 @@ longjmp_msg:
88
89 #define __longjmp ____longjmp_chk
90
91 -#ifdef PIC
92 -# define CALL_FAIL __GI___fortify_fail
93 -#else
94 -# define CALL_FAIL __fortify_fail
95 -#endif
96 -
97 #define CHECK_RSP(reg) \
98 cmp.ltu p0, p8 = reg, r12; \
99 (p8) br.cond.dpnt .Lok;; \
100 addl r28 = @ltoffx(longjmp_msg#), r1;; \
101 ld8.mov r28 = [r28], longjmp_msg#;; \
102 ld8 out0 = [r28]; \
103 - br.call.sptk.many b0 = CALL_FAIL#;; \
104 + br.call.sptk.many b0 = HIDDEN_JUMPTARGET(__fortify_fail)#;; \
105 .Lok:
106
107 #include "__longjmp.S"