Skip to content

Commit

Permalink
libzpool: Don't call pthread_attr_setguardsize() on CHERI platforms
Browse files Browse the repository at this point in the history
The kernel doesn't provide guard pages and libthr returns EINVAL if the
specified guard size is non-zero, so just avoid calling it with the aim of
making zdb usable.
  • Loading branch information
markjdb authored and bsdjhb committed Aug 7, 2024
1 parent de6b5cc commit 0c817b0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/libzpool/kernel.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ zk_thread_create(void (*func)(void *), void *arg, size_t stksize, int state)
* multiple of system page size.
*/
VERIFY0(pthread_attr_setstacksize(&attr, stksize));
#ifndef __CHERI_PURE_CAPABILITY__
VERIFY0(pthread_attr_setguardsize(&attr, PAGESIZE));
#endif

VERIFY(ztw = malloc(sizeof (*ztw)));
ztw->func = func;
Expand Down

0 comments on commit 0c817b0

Please sign in to comment.