]> git.ipfire.org Git - thirdparty/glibc.git/commit
nptl: Fix MADV_GUARD_INSTALL logic for thread without guard page (BZ 33356)
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Mon, 8 Sep 2025 16:06:13 +0000 (13:06 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 23 Sep 2025 13:29:24 +0000 (10:29 -0300)
commit855bfa2566bbefefa27c516b344df58a75824a5c
treee44ee86805224f0d4c112526ff8db983487b0505
parentb8254a047fe0e2f8f0221f67339d8bcdb637fdda
nptl: Fix MADV_GUARD_INSTALL logic for thread without guard page (BZ 33356)

The main issue is that setup_stack_prot fails to account for cases where
the cached thread stack lacks a guard page, which can cause madvise to
fail. Update the logic to also handle whether MADV_GUARD_INSTALL is
supported when resizing the guard page.

Checked on x86_64-linux-gnu with 6.8.0 and 6.15 kernels.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
nptl/allocatestack.c
nptl/tst-guard1.c