mirror of
git://git.musl-libc.org/musl
synced 2025-01-30 02:22:43 +00:00
harden thread start with failed scheduling against broken __clone
commit8a544ee3a2
introduced a dependency of the failure path for explicit scheduling at thread creation on __clone's handling of the start function returning, which should result in SYS_exit. as noted in commit05870abeaa
, the arm version of __clone was broken in this case. in the past, the mips version was also broken; it was fixed in commit8b2b61e000
. since this code path is pretty much entirely untested (previously only reachable in applications that call the public clone() and return from the start function) and consists of fragile per-arch asm, don't assume it works, at least not until it's been thoroughly tested. instead make the SYS_exit syscall from the start function's failure path.
This commit is contained in:
parent
f7e464bff4
commit
f5eee489f7
@ -185,7 +185,7 @@ static int start(void *p)
|
||||
__wait(&args->control, 0, 2, 1);
|
||||
if (args->control) {
|
||||
__syscall(SYS_set_tid_address, &args->control);
|
||||
return 0;
|
||||
for (;;) __syscall(SYS_exit, 0);
|
||||
}
|
||||
}
|
||||
__syscall(SYS_rt_sigprocmask, SIG_SETMASK, &args->sig_mask, 0, _NSIG/8);
|
||||
|
Loading…
Reference in New Issue
Block a user