mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-11 17:04:19 +01:00
Ensure that the semaphore value is re-checked after sem_lock
is re-acquired, after the condition variable is signalled. PR: http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/127545 MFC after: 5 days Reviewed by: attilio
This commit is contained in:
parent
b2966a5a2f
commit
77d8bf9cc7
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=189736
@ -727,7 +727,7 @@ kern_sem_wait(struct thread *td, semid_t id, int tryflag,
|
||||
#endif
|
||||
DP(("kern_sem_wait value = %d, tryflag %d\n", ks->ks_value, tryflag));
|
||||
vfs_timestamp(&ks->ks_atime);
|
||||
if (ks->ks_value == 0) {
|
||||
while (ks->ks_value == 0) {
|
||||
ks->ks_waiters++;
|
||||
if (tryflag != 0)
|
||||
error = EAGAIN;
|
||||
|
Loading…
Reference in New Issue
Block a user