Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F162629683
D48075.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
769 B
Referenced Files
None
Subscribers
None
D48075.diff
View Options
diff --git a/sys/kern/kern_osd.c b/sys/kern/kern_osd.c
--- a/sys/kern/kern_osd.c
+++ b/sys/kern/kern_osd.c
@@ -180,6 +180,18 @@
osdm[type].osd_destructors[slot - 1] = NULL;
OSD_DEBUG("Slot deregistration (type=%u, slot=%u).", type, slot);
+#ifdef INVARIANTS
+ /*
+ * We trash the slot's osd_methods upon deregistration so that we take
+ * a fault if something calls them, rather than potentially
+ * inadvertently executing some arbitrary function if another module's
+ * been mapped over the one that deregistered.
+ */
+ for (u_int method = 0; method < osdm[type].osd_nmethods; method++) {
+ OSD_METHOD(osdm[type], slot, method) = (void *)0xdeadc0de;
+ }
+#endif
+
rm_wunlock(&osdm[type].osd_object_lock);
sx_xunlock(&osdm[type].osd_module_lock);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jul 16, 6:36 AM (17 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34338785
Default Alt Text
D48075.diff (769 B)
Attached To
Mode
D48075: kern: osd: trash a slot's methods upon deregistration
Attached
Detach File
Event Timeline
Log In to Comment