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
commit67eeec4810ead3224dc653eccc665c21e34e7c8e (patch)
tree60f4848efd8cfb6f22951f957318ed0a712788b9
parent4431dcae87aa110fac28b84c4ce20feb6c0fff16 (diff)
downloadsrc-67eeec4810ead3224dc653eccc665c21e34e7c8e.tar.gz
src-67eeec4810ead3224dc653eccc665c21e34e7c8e.zip
Fix race condition in callout CPU migration.
Approved by: so Security: FreeBSD-EN-20:22.callout
Notes
Notes: svn path=/releng/12.1/; 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 81b4a14ecf08..d08e202442a7 100644
--- a/sys/kern/kern_timeout.c
+++ b/sys/kern/kern_timeout.c
@@ -1270,7 +1270,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
@@ -1318,7 +1318,7 @@ again:
/* Reacquire locks previously released. */
PICKUP_GIANT();
- CC_LOCK(cc);
+ goto again;
}
c->c_flags &= ~CALLOUT_ACTIVE;
} else if (use_lock &&