mirror of
git://sourceware.org/git/glibc.git
synced 2024-11-27 03:41:23 +08:00
nptl: Don't madvise user provided stack
User provided stack should not be released nor madvised at thread exit because it's owned by the user. If the memory is shared or file based then MADV_DONTNEED can have unwanted effects. With memory tagging on aarch64 linux the tags are dropped and thus it may invalidate pointers. Tested on aarch64-linux-gnu with MTE, it fixes FAIL: nptl/tst-stack3 FAIL: nptl/tst-stack3-mem
This commit is contained in:
parent
f6b955e8ba
commit
087942251f
@ -549,8 +549,9 @@ START_THREAD_DEFN
|
||||
}
|
||||
#endif
|
||||
|
||||
advise_stack_range (pd->stackblock, pd->stackblock_size, (uintptr_t) pd,
|
||||
pd->guardsize);
|
||||
if (!pd->user_stack)
|
||||
advise_stack_range (pd->stackblock, pd->stackblock_size, (uintptr_t) pd,
|
||||
pd->guardsize);
|
||||
|
||||
if (__glibc_unlikely (pd->cancelhandling & SETXID_BITMASK))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user