wok-4.x view glibc/stuff/patches/glibc-2.22-CVE-2015-8777.patch @ rev 12476

Up glibc (2.22) with CVE patchs
author Stanislas Leduc <shann@slitaz.org>
date Wed Mar 15 11:41:38 2023 +0000 (16 months ago)
parents
children
line source
1 Based on:
2 https://sourceware.org/bugzilla/show_bug.cgi?id=18928
3 https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=patch;h=dc22a1ec157d02529a0b17986679d3f1c122985e
5 From dc22a1ec157d02529a0b17986679d3f1c122985e Mon Sep 17 00:00:00 2001
6 From: Florian Weimer <fweimer@redhat.com>
7 Date: Thu, 15 Oct 2015 09:23:07 +0200
8 Subject: [PATCH] Always enable pointer guard [BZ #18928]
10 Honoring the LD_POINTER_GUARD environment variable in AT_SECURE mode
11 has security implications. This commit enables pointer guard
12 unconditionally, and the environment variable is now ignored.
14 [BZ #18928]
15 * sysdeps/generic/ldsodefs.h (struct rtld_global_ro): Remove
16 _dl_pointer_guard member.
17 * elf/rtld.c (_rtld_global_ro): Remove _dl_pointer_guard
18 initializer.
19 (security_init): Always set up pointer guard.
20 (process_envvars): Do not process LD_POINTER_GUARD.
22 ---
23 elf/rtld.c | 15 ++++-----------
24 sysdeps/generic/ldsodefs.h | 3 ---
25 2 files changed, 4 insertions(+), 14 deletions(-)
27 diff --git a/elf/rtld.c b/elf/rtld.c
28 index 5043046..6c2632d 100644
29 --- a/elf/rtld.c
30 +++ b/elf/rtld.c
31 @@ -162,7 +162,6 @@ struct rtld_global_ro _rtld_global_ro attribute_relro =
32 ._dl_hwcap_mask = HWCAP_IMPORTANT,
33 ._dl_lazy = 1,
34 ._dl_fpu_control = _FPU_DEFAULT,
35 - ._dl_pointer_guard = 1,
36 ._dl_pagesize = EXEC_PAGESIZE,
37 ._dl_inhibit_cache = 0,
39 @@ -709,15 +708,12 @@ security_init (void)
40 #endif
42 /* Set up the pointer guard as well, if necessary. */
43 - if (GLRO(dl_pointer_guard))
44 - {
45 - uintptr_t pointer_chk_guard = _dl_setup_pointer_guard (_dl_random,
46 - stack_chk_guard);
47 + uintptr_t pointer_chk_guard
48 + = _dl_setup_pointer_guard (_dl_random, stack_chk_guard);
49 #ifdef THREAD_SET_POINTER_GUARD
50 - THREAD_SET_POINTER_GUARD (pointer_chk_guard);
51 + THREAD_SET_POINTER_GUARD (pointer_chk_guard);
52 #endif
53 - __pointer_chk_guard_local = pointer_chk_guard;
54 - }
55 + __pointer_chk_guard_local = pointer_chk_guard;
57 /* We do not need the _dl_random value anymore. The less
58 information we leave behind, the better, so clear the
59 @@ -2472,9 +2468,6 @@ process_envvars (enum mode *modep)
60 GLRO(dl_use_load_bias) = envline[14] == '1' ? -1 : 0;
61 break;
62 }
63 -
64 - if (memcmp (envline, "POINTER_GUARD", 13) == 0)
65 - GLRO(dl_pointer_guard) = envline[14] != '0';
66 break;
68 case 14:
69 diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
70 index 7a0fe8d..78e3a97 100644
71 --- a/sysdeps/generic/ldsodefs.h
72 +++ b/sysdeps/generic/ldsodefs.h
73 @@ -592,9 +592,6 @@ struct rtld_global_ro
74 /* List of auditing interfaces. */
75 struct audit_ifaces *_dl_audit;
76 unsigned int _dl_naudit;
77 -
78 - /* 0 if internal pointer values should not be guarded, 1 if they should. */
79 - EXTERN int _dl_pointer_guard;
80 };
81 # define __rtld_global_attribute__
82 # if IS_IN (rtld)
83 --
84 2.17.1