FreeBSD Bugzilla – Attachment 153476 Details for
Bug 198014
Signals can lead to an inconsistency in PI mutex ownership
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to restore owner after umtx_pi_claim fails
umtx_pi_claim_restore.patch (text/plain), 1.11 KB, created by
eric
on 2015-02-24 21:26:03 UTC
(
hide
)
Description:
Patch to restore owner after umtx_pi_claim fails
Filename:
MIME Type:
Creator:
eric
Created:
2015-02-24 21:26:03 UTC
Size:
1.11 KB
patch
obsolete
>commit 987cd93bb90597d81e39ca6c968550bf129b8747 >Author: evangyzen <eric_van_gyzen@dell.com> >Date: Tue Feb 24 14:25:08 2015 -0500 > > When locking a PI mutex, restore original owner on a rare error path > > When failing to claim ownership of a umtx_pi, > restore the umutex owner to its previous, unowned state. > This avoids compounding an existing problem of inconsistent ownership. > > Submitted by: Eric van Gyzen <eric_van_gyzen@dell.com> > Obtained from: Dell Inc. > >diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c >index cc7c16d..11f312a 100644 >--- a/sys/kern/kern_umtx.c >+++ b/sys/kern/kern_umtx.c >@@ -1741,6 +1741,17 @@ do_lock_pi(struct thread *td, struct umutex *m, uint32_t flags, > error = umtx_pi_claim(pi, td); > umtxq_unbusy(&uq->uq_key); > umtxq_unlock(&uq->uq_key); >+ if (error) { >+ /* >+ * Since we're going to return an >+ * error, restore the m_owner to its >+ * previous, unowned state to avoid >+ * compounding the problem. >+ */ >+ (void) casuword32(&m->m_owner, >+ id | UMUTEX_CONTESTED, >+ UMUTEX_CONTESTED); >+ } > break; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 198014
:
153475
| 153476 |
153477
|
153485
|
153486
|
153487
|
153524