Skip to content

Commit

Permalink
libthr: Fail pthread_attr_setguardsize with a non-zero size for Cheri…
Browse files Browse the repository at this point in the history
…ABI.
  • Loading branch information
bsdjhb committed Jun 20, 2023
1 parent 26a76a6 commit e84906f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/libthr/thread/thr_attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -461,11 +461,13 @@ _thr_attr_setguardsize(pthread_attr_t *attr, size_t guardsize __unused)
/* Check for invalid arguments. */
if (attr == NULL || *attr == NULL)
ret = EINVAL;
#ifdef __CHERI_PURE_CAPABILITY__
else if (guardsize != 0)
ret = EINVAL;
#endif
else {
#ifndef __CHERI_PURE_CAPABILITY__
/* Save the stack size. */
(*attr)->guardsize_attr = guardsize;
#endif
ret = 0;
}
return (ret);
Expand Down

0 comments on commit e84906f

Please sign in to comment.