]> git.ipfire.org Git - ipfire-2.x.git/blob - src/patches/glibc/glibc-rh1299319-0.patch
glibc: new RHEL6 patches / fix CVE-2015-7547 and more
[ipfire-2.x.git] / src / patches / glibc / glibc-rh1299319-0.patch
1 commit 2c1094bd700e63a8d7f547b3f5495bedb55c0a08
2 Author: Ulrich Drepper <drepper@gmail.com>
3 Date: Thu Dec 22 22:43:39 2011 -0500
4
5 Create internal threads with sufficient stack size
6
7 Index: glibc-2.12-2-gc4ccff1/nptl/Versions
8 ===================================================================
9 --- glibc-2.12-2-gc4ccff1.orig/nptl/Versions
10 +++ glibc-2.12-2-gc4ccff1/nptl/Versions
11 @@ -255,6 +255,6 @@ libpthread {
12 GLIBC_PRIVATE {
13 __pthread_initialize_minimal;
14 __pthread_clock_gettime; __pthread_clock_settime;
15 - __pthread_unwind;
16 + __pthread_unwind; __pthread_get_minstack;
17 }
18 }
19 Index: glibc-2.12-2-gc4ccff1/nptl/nptl-init.c
20 ===================================================================
21 --- glibc-2.12-2-gc4ccff1.orig/nptl/nptl-init.c
22 +++ glibc-2.12-2-gc4ccff1/nptl/nptl-init.c
23 @@ -507,3 +507,13 @@ __pthread_initialize_minimal_internal (i
24 }
25 strong_alias (__pthread_initialize_minimal_internal,
26 __pthread_initialize_minimal)
27 +
28 +
29 +size_t
30 +__pthread_get_minstack (const pthread_attr_t *attr)
31 +{
32 + struct pthread_attr *iattr = (struct pthread_attr *) attr;
33 +
34 + return (GLRO(dl_pagesize) + __static_tls_size + PTHREAD_STACK_MIN
35 + + iattr->guardsize);
36 +}
37 Index: glibc-2.12-2-gc4ccff1/nptl/pthreadP.h
38 ===================================================================
39 --- glibc-2.12-2-gc4ccff1.orig/nptl/pthreadP.h
40 +++ glibc-2.12-2-gc4ccff1/nptl/pthreadP.h
41 @@ -397,6 +397,7 @@ weak_function;
42
43 extern void __pthread_init_static_tls (struct link_map *) attribute_hidden;
44
45 +extern size_t __pthread_get_minstack (const pthread_attr_t *attr);
46
47 /* Namespace save aliases. */
48 extern int __pthread_getschedparam (pthread_t thread_id, int *policy,
49 Index: glibc-2.12-2-gc4ccff1/nptl/sysdeps/unix/sysv/linux/timer_routines.c
50 ===================================================================
51 --- glibc-2.12-2-gc4ccff1.orig/nptl/sysdeps/unix/sysv/linux/timer_routines.c
52 +++ glibc-2.12-2-gc4ccff1/nptl/sysdeps/unix/sysv/linux/timer_routines.c
53 @@ -165,7 +165,7 @@ __start_helper_thread (void)
54 and should go away automatically when canceled. */
55 pthread_attr_t attr;
56 (void) pthread_attr_init (&attr);
57 - (void) pthread_attr_setstacksize (&attr, PTHREAD_STACK_MIN);
58 + (void) pthread_attr_setstacksize (&attr, __pthread_get_minstack (&attr));
59
60 /* Block all signals in the helper thread but SIGSETXID. To do this
61 thoroughly we temporarily have to block all signals here. The