FreeBSD Bugzilla – Attachment 170431 Details for
Bug 209282
dns/bind910 crash
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
patch-assertion
bind910.diff (text/plain), 3.89 KB, created by
Mathieu Arnold
on 2016-05-18 10:57:29 UTC
(
hide
)
Description:
patch-assertion
Filename:
MIME Type:
Creator:
Mathieu Arnold
Created:
2016-05-18 10:57:29 UTC
Size:
3.89 KB
patch
obsolete
>commit 04a6d1de64b2b600f1c3a67b82abc32392048692 >Author: Mark Andrews <marka@isc.org> >Date: 2016-05-17 13:13:45 +1000 > > 4366. [bug] Address race condition when updating rbtnode bit > fields. [RT #42379] > > (cherry picked from commit e2047969decfc0c3fc1a946ccade993cab9c9315) > >diff --git CHANGES CHANGES >index 085ae83..8a571a3 100644 >--- CHANGES >+++ CHANGES >@@ -1,3 +1,6 @@ >+4366. [bug] Address race condition when updating rbtnode bit >+ fields. [RT #42379] >+ > 4363. [port] Turn off triggering UAC when running BINDInstall > temporarily. > >diff --git lib/dns/include/dns/rbt.h lib/dns/include/dns/rbt.h >index 3df1789..ef45840 100644 >--- lib/dns/include/dns/rbt.h >+++ lib/dns/include/dns/rbt.h >@@ -92,7 +92,18 @@ struct dns_rbtnode { > * > * In each case below the "range" indicated is what's _necessary_ for > * the bitfield to hold, not what it actually _can_ hold. >+ * >+ * Note: Tree lock must be held before modifying these >+ * bit-fields. >+ * >+ * Note: The two "unsigned int :0;" unnamed bitfields on either >+ * side of the bitfields below are scaffolding that border the >+ * set of bitfields which are accessed after acquiring the tree >+ * lock. Please don't insert any other bitfield members between >+ * the unnamed bitfields unless they should also be accessed >+ * after acquiring the tree lock. > */ >+ unsigned int :0; /* start of bitfields c/o tree lock */ > unsigned int is_root : 1; /*%< range is 0..1 */ > unsigned int color : 1; /*%< range is 0..1 */ > unsigned int find_callback : 1; /*%< range is 0..1 */ >@@ -113,16 +124,7 @@ struct dns_rbtnode { > > /* node needs to be cleaned from rpz */ > unsigned int rpz : 1; >- >- /*@{*/ >- /*! >- * These values are used in the RBT DB implementation. The appropriate >- * node lock must be held before accessing them. >- */ >- unsigned int dirty:1; >- unsigned int wild:1; >- unsigned int locknum:DNS_RBT_LOCKLENGTH; >- /*@}*/ >+ unsigned int :0; /* end of bitfields c/o tree lock */ > > #ifdef DNS_RBT_USEHASH > unsigned int hashval; >@@ -145,11 +147,30 @@ struct dns_rbtnode { > /*! > * These values are used in the RBT DB implementation. The appropriate > * node lock must be held before accessing them. >+ * >+ * Note: The two "unsigned int :0;" unnamed bitfields on either >+ * side of the bitfields below are scaffolding that border the >+ * set of bitfields which are accessed after acquiring the node >+ * lock. Please don't insert any other bitfield members between >+ * the unnamed bitfields unless they should also be accessed >+ * after acquiring the node lock. >+ * >+ * NOTE: Do not merge these fields into bitfields above, as >+ * they'll all be put in the same qword that could be accessed >+ * without the node lock as it shares the qword with other >+ * members. Leave these members here so that they occupy a >+ * separate region of memory. > */ > void *data; >+ unsigned int :0; /* start of bitfields c/o node lock */ >+ unsigned int dirty:1; >+ unsigned int wild:1; >+ unsigned int locknum:DNS_RBT_LOCKLENGTH; > #ifndef DNS_RBT_USEISCREFCOUNT > unsigned int references:DNS_RBT_REFLENGTH; >-#else >+#endif >+ unsigned int :0; /* end of bitfields c/o node lock */ >+#ifdef DNS_RBT_USEISCREFCOUNT > isc_refcount_t references; /* note that this is not in the bitfield */ > #endif > /*@}*/ >diff --git lib/dns/rbt.c lib/dns/rbt.c >index 1e2257b..8b6a699 100644 >--- lib/dns/rbt.c >+++ lib/dns/rbt.c >@@ -2895,6 +2895,18 @@ check_properties_helper(dns_rbtnode_t *node) { > return (ISC_FALSE); > } > >+ if ((DOWN(node) != NULL) && (!IS_ROOT(DOWN(node)))) >+ return (ISC_FALSE); >+ >+ if (IS_ROOT(node)) { >+ if ((PARENT(node) != NULL) && >+ (DOWN(PARENT(node)) != node)) >+ return (ISC_FALSE); >+ >+ if (get_upper_node(node) != PARENT(node)) >+ return (ISC_FALSE); >+ } >+ > /* If node is assigned to the down_ pointer of its parent, it is > * a subtree root and must have the flag set. > */
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 Raw
Actions:
View
Attachments on
bug 209282
: 170431