aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGordon Tetlow <gordon@FreeBSD.org>2020-12-01 19:37:33 +0000
committerGordon Tetlow <gordon@FreeBSD.org>2020-12-01 19:37:33 +0000
commit7b3386dba21f57907931b2e6f09f741633ea3349 (patch)
tree90bfb1c4dafd85abe7594436b2169ebd3f3ea305
parent0b4300a472c89506709341530788ad9815c05bd3 (diff)
downloadsrc-7b3386dba21f57907931b2e6f09f741633ea3349.tar.gz
src-7b3386dba21f57907931b2e6f09f741633ea3349.zip
Fix race condition in callout CPU migration.
Approved by: so Security: FreeBSD-EN-20:22.callout
Notes
Notes: svn path=/releng/12.2/; revision=368254
-rw-r--r--sys/kern/kern_timeout.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/kern_timeout.c b/sys/kern/kern_timeout.c
index e7fadbf7be8f..51696434a385 100644
--- a/sys/kern/kern_timeout.c
+++ b/sys/kern/kern_timeout.c
@@ -1271,7 +1271,7 @@ again:
* just wait for the current invocation to
* finish.
*/
- while (cc_exec_curr(cc, direct) == c) {
+ if (cc_exec_curr(cc, direct) == c) {
/*
* Use direct calls to sleepqueue interface
* instead of cv/msleep in order to avoid
@@ -1319,7 +1319,7 @@ again:
/* Reacquire locks previously released. */
PICKUP_GIANT();
- CC_LOCK(cc);
+ goto again;
}
c->c_flags &= ~CALLOUT_ACTIVE;
} else if (use_lock &&