Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F156443418
D40481.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
643 B
Referenced Files
None
Subscribers
None
D40481.diff
View Options
diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c
--- a/sys/kern/kern_umtx.c
+++ b/sys/kern/kern_umtx.c
@@ -834,8 +834,17 @@
}
error = msleep_sbt(uq, &uc->uc_lock, PCATCH | PDROP, wmesg,
sbt, 0, flags);
+retrylock:
uc = umtxq_getchain(&uq->uq_key);
mtx_lock(&uc->uc_lock);
+ if (__predict_false(uc != umtxq_getchain(&uq->uq_key))) {
+ /*
+ * Deal with race with umtxq_requeue(). It holds
+ * both the old lock and the new lock.
+ */
+ mtx_unlock(&uc->uc_lock);
+ goto retrylock;
+ }
if (error == EINTR || error == ERESTART)
break;
if (error == EWOULDBLOCK && (flags & C_ABSOLUTE) != 0) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, May 14, 5:46 PM (7 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33051346
Default Alt Text
D40481.diff (643 B)
Attached To
Mode
D40481: umtx: close race between umtxq_sleep() and umtxq_requeue()
Attached
Detach File
Event Timeline
Log In to Comment