Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F106067002
D8624.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D8624.diff
View Options
Index: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
===================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
+++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
@@ -157,6 +157,10 @@
* /etc/system.
*/
int dtrace_destructive_disallow = 0;
+#ifndef illumos
+/* Positive logic version of dtrace_destructive_disallow for loader tunable */
+int dtrace_allow_destructive = 1;
+#endif
dtrace_optval_t dtrace_nonroot_maxsize = (16 * 1024 * 1024);
size_t dtrace_difo_maxsize = (256 * 1024);
dtrace_optval_t dtrace_dof_maxsize = (8 * 1024 * 1024);
Index: head/sys/cddl/dev/dtrace/dtrace_load.c
===================================================================
--- head/sys/cddl/dev/dtrace/dtrace_load.c
+++ head/sys/cddl/dev/dtrace/dtrace_load.c
@@ -52,6 +52,17 @@
int i;
#endif
+#ifndef illumos
+ /*
+ * DTrace uses negative logic for the destructive mode switch, so it
+ * is required to translate from the sysctl which uses positive logic.
+ */
+ if (dtrace_allow_destructive)
+ dtrace_destructive_disallow = 0;
+ else
+ dtrace_destructive_disallow = 1;
+#endif
+
/* Hook into the trap handler. */
dtrace_trap_func = dtrace_trap;
Index: head/sys/cddl/dev/dtrace/dtrace_sysctl.c
===================================================================
--- head/sys/cddl/dev/dtrace/dtrace_sysctl.c
+++ head/sys/cddl/dev/dtrace/dtrace_sysctl.c
@@ -92,3 +92,6 @@
SYSCTL_QUAD(_kern_dtrace, OID_AUTO, helper_actions_max, CTLFLAG_RW,
&dtrace_helper_actions_max, 0, "maximum number of allowed helper actions");
+
+SYSCTL_INT(_security_bsd, OID_AUTO, allow_destructive_dtrace, CTLFLAG_RDTUN,
+ &dtrace_allow_destructive, 1, "Allow destructive mode DTrace scripts");
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Dec 25, 8:16 PM (10 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15598459
Default Alt Text
D8624.diff (1 KB)
Attached To
Mode
D8624: Add tunable to disable destructive dtrace Security
Attached
Detach File
Event Timeline
Log In to Comment