summarylogtreecommitdiffstats
path: root/0002-tls-libwidevinecdm.so-since-4.10.2252.0-has-TLS-with.patch
blob: 658d034cb00cbd85aa8f73eb0b6f40ce9de0f0d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
From fc5f14ff84b8e3381b3a732ae1ea9861d6911baf Mon Sep 17 00:00:00 2001
From: Portisch <hugo.portisch@yahoo.de>
Date: Sat, 5 Jun 2021 19:41:25 +0200
Subject: [PATCH 2/2] tls: libwidevinecdm.so: since 4.10.2252.0 has TLS with
 64-byte alignment Change the max_align to 64U instead 16 to make it possible
 to use dlopen again. Tests by changing TLS_TCB_ALIGN directly showed up some
 random crashes. Reverence: https://lkml.org/lkml/2020/7/3/754

---
 elf/dl-tls.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/elf/dl-tls.c b/elf/dl-tls.c
index 093cdddb7e..7314c2f9b2 100644
--- a/elf/dl-tls.c
+++ b/elf/dl-tls.c
@@ -220,6 +220,11 @@ void
 _dl_determine_tlsoffset (void)
 {
   size_t max_align = TCB_ALIGNMENT;
+  /* libwidevinecdm.so: since 4.10.2252.0 has TLS with 64-byte alignment.
+     Since TLS is initialized before audit modules are loaded and slotinfo
+     information is available, this is not taken into account below in
+     the audit case.  */
+  max_align = MAX (max_align, 64U);
   size_t freetop = 0;
   size_t freebottom = 0;
 
-- 
2.34.1