#21 rhbz1888842: Temp workaround BTI failure
Closed 3 years ago by codonell. Opened 3 years ago by jlinton.
rpms/ jlinton/glibc jlinton/f33  into  f33

@@ -0,0 +1,39 @@ 

+ From b26d315640480956ced01ce29d1c8e4be8dd8002 Mon Sep 17 00:00:00 2001

+ From: Jeremy Linton <jeremy.linton@arm.com>

+ Date: Tue, 13 Oct 2020 13:16:32 -0500

+ Subject: [PATCH] rhbz1888842: Short term BTI workaround

+ 

+ This patch will skip enabling BTI on systemd services

+ with MemoryDenyWriteExecute as the upstream fixes

+ will probably take another few weeks to land.

+ 

+ Replace this, when it causes a merge conflit (due

+ to upstream fixes in this file)

+ 

+ Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>

+ ---

+  sysdeps/aarch64/dl-bti.c | 8 ++------

+  1 file changed, 2 insertions(+), 6 deletions(-)

+ 

+ diff --git a/sysdeps/aarch64/dl-bti.c b/sysdeps/aarch64/dl-bti.c

+ index 196e462520..d580ac581c 100644

+ --- a/sysdeps/aarch64/dl-bti.c

+ +++ b/sysdeps/aarch64/dl-bti.c

+ @@ -40,12 +40,8 @@ enable_bti (struct link_map *map, const char *program)

+  

+  	if (__mprotect (start, len, prot) < 0)

+  	  {

+ -	    if (program)

+ -	      _dl_fatal_printf ("%s: mprotect failed to turn on BTI\n",

+ -				map->l_name);

+ -	    else

+ -	      _dl_signal_error (errno, map->l_name, "dlopen",

+ -				N_("mprotect failed to turn on BTI"));

+ +	      _dl_printf ("%s: mprotect failed to turn on BTI %d\n",

+ +			  map->l_name, errno);

+  	  }

+        }

+    return 0;

+ -- 

+ 2.28.0

+ 

file modified
+1
@@ -169,6 +169,7 @@ 

  Patch29: glibc-fedora-nsswitch.patch

  Patch30: glibc-deprecated-selinux-makedb.patch

  Patch31: glibc-deprecated-selinux-nscd.patch

+ Patch32: 0001-rhbz1888842-Short-term-BTI-workaround.patch

  

  ##############################################################################

  # Continued list of core "glibc" package information:

This is fedora only patch which works around
BTI related boot/service failures.

Signed-off-by: Jeremy Linton jeremy.linton@arm.com

I think we want to see an upstream fix for this first.

This is only intended to exist as long as an upstream fix is in progress. Once that is merged this becomes unneeded. Given that this fixes a fedora boot failure that can be reproduced with any aarch64 VM its actually fairly critical and probably should have been merged a few weeks back before the release. I'm also worried (although my understanding is based more on the rumor mill) that we are going to want this fix to land really soon, otherwise we may find ourselves in a situation where fedora doesn't boot on a very popular piece of hardware.

@jlinton When, concretely, would we remove this patch?

I don't (yet) have a concrete timeframe. At the moment, it appears the final fix is going to involve a kernel patch, and replacing this mprotect with a mmap, which remaps the segment. The latter requires a bit of refactoring glibc. That should happen RSN.

I would say the worse case is a few months, or maybe the entirety of the f33 cycle depending on whether its worth it to back-port a large fix. From a risk perspective to other arches, it might not be worth it.

But at the moment, as you can see by the lack of a master/rawhide request, I'm running under the assumption that a fix will be posted in the near future. AFAIK, this is actively being worked on, If that turns out not to be the case, I will dedicate the time and post something myself.

@jlinton This must go upstream as a temporary workaround that all distributions inherit until you are ready to back out the fix. You want this fixed everywhere there is a distribution building for AArch64. We should not be carrying this here if we can't answer an exact date for when we'll back out the patch. And believe me, I just recently made a similar mistake with a syscall errror handling change in glibc that I now what to coordinate backing out.

I'm closing this PR. This fix needs to go upstream for all distributions supporting AArch64.

Pull-Request has been closed by codonell

3 years ago