live-bootstrap/steps/musl-1.1.24/patches/set_thread_area.patch
fosslinux a67db8fcbd Make patches relative to where tarballs are extracted
Ever since an old patch version, it has (for reasonable security
reasons) not supported patched with ../ in the filename.
Many of our patches have been relying on this behaviour being OK,
because we start off with an ancient patch version that didn't perform
such checks. As soon as we need this behaviour after we build a newer
patch though, we will have problems.

So, let's change the policy.
Patches are relative to where tarballs are extracted, rather than the
"working directory" - e.g. have patches for `coreutils-9.4/src/cp.c`
instead of `src/cp.c`.
Keeping this consistent has a few implications;
- patches are applied from the build/ directory in bash era now, with
  `-p0`
- when patches are manually applied in the bash era, use `-p` as
  required, usually `-p1`
- in kaem era where patches are always manually applied, `-p1` is used
2024-12-23 15:20:42 +11:00

35 lines
1.1 KiB
Diff

SPDX-FileCopyrightText: 2020 Rich Felker <dalias@aerifal.cx>
SPDX-License-Identifier: MIT
From 0b0640219338b80cf47026d1970b5503414ed7f3 Mon Sep 17 00:00:00 2001
From: Rich Felker <dalias@aerifal.cx>
Date: Sun, 30 Aug 2020 21:37:12 -0400
Subject: fix i386 __set_thread_area fallback
this code is only needed for pre-2.6 kernels, which are not actually
supported anyway, and was never tested. the fallback path using
SYS_modify_ldt failed to clear the upper bits of %eax (all ones due to
SYS_set_thread_area's return value being an error) before modifying
%al to attempt a new syscall.
---
src/thread/i386/__set_thread_area.s | 1 +
1 file changed, 1 insertion(+)
(limited to 'src/thread/i386/__set_thread_area.s')
diff --git src/thread/i386/__set_thread_area.s src/thread/i386/__set_thread_area.s
index c2c21dd5..aa6852be 100644
--- musl-1.1.24/src/thread/i386/__set_thread_area.s
+++ musl-1.1.24/src/thread/i386/__set_thread_area.s
@@ -28,6 +28,7 @@ __set_thread_area:
ret
2:
mov %ebx,%ecx
+ xor %eax,%eax
xor %ebx,%ebx
xor %edx,%edx
mov %ebx,(%esp)
--
cgit v1.2.1