summaryrefslogtreecommitdiff
path: root/src/polkitbackend/polkitbackendjsauthority.c
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2014-07-01 20:00:48 +0200
committerMiloslav Trmač <mitr@redhat.com>2015-06-19 04:30:54 +0200
commit2881f8b260c03df29afb0e35e6d1707240f95ad7 (patch)
tree77012fce3db2f7f49fef851e662abe0888d68a46 /src/polkitbackend/polkitbackendjsauthority.c
parent5c668722320eb363f713a0998934aa48fecd56cb (diff)
downloadpolkit-2881f8b260c03df29afb0e35e6d1707240f95ad7.tar.gz
Prevent builds against SpiderMonkey with exact stack rooting
“Exact stack rooting” means that every on-stack pointer to a JavaScript value needs to be registered with the runtime. The current code doesn't do this, so it is not safe to use against a runtime with this configuration. Luckily this configuration is not default. See https://developer.mozilla.org/en-US/docs/SpiderMonkey/Internals/GC/Exact_Stack_Rooting and other pages in the wiki for what the conversion would require. https://bugs.freedesktop.org/show_bug.cgi?id=69501
Diffstat (limited to 'src/polkitbackend/polkitbackendjsauthority.c')
-rw-r--r--src/polkitbackend/polkitbackendjsauthority.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/polkitbackend/polkitbackendjsauthority.c b/src/polkitbackend/polkitbackendjsauthority.c
index 39f7060..22812a6 100644
--- a/src/polkitbackend/polkitbackendjsauthority.c
+++ b/src/polkitbackend/polkitbackendjsauthority.c
@@ -43,6 +43,13 @@
#include "initjs.h" /* init.js */
+#ifdef JSGC_USE_EXACT_ROOTING
+/* See https://developer.mozilla.org/en-US/docs/SpiderMonkey/Internals/GC/Exact_Stack_Rooting
+ * for more information about exact stack rooting.
+ */
+#error "This code is not safe in SpiderMonkey exact stack rooting configurations"
+#endif
+
/**
* SECTION:polkitbackendjsauthority
* @title: PolkitBackendJsAuthority