Skip to content

Commit 60ac12e

Browse files
author
Mike Pall
committed
Merge branch 'master' into v2.1
2 parents 6097795 + 7eb9684 commit 60ac12e

File tree

3 files changed

+34
-10
lines changed

3 files changed

+34
-10
lines changed

doc/ext_ffi_semantics.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1219,7 +1219,7 @@ <h2 id="status">Current Status</h2>
12191219
<li>Table initializers.</li>
12201220
<li>Initialization of nested <tt>struct</tt>/<tt>union</tt> types.</li>
12211221
<li>Non-default initialization of VLA/VLS or large C&nbsp;types
1222-
(&gt; 128&nbsp;bytes or &gt; 16 array elements.</li>
1222+
(&gt; 128&nbsp;bytes or &gt; 16 array elements).</li>
12231223
<li>Bitfield initializations.</li>
12241224
<li>Pointer differences for element sizes that are not a power of
12251225
two.</li>

doc/extensions.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ <h2 id="exceptions">C++ Exception Interoperability</h2>
408408
</tr>
409409
<tr class="even">
410410
<td class="excplatform">Windows/x64</td>
411-
<td class="exccompiler">MSVC or WinSDK</td>
411+
<td class="exccompiler">MSVC</td>
412412
<td class="excinterop"><b style="color: #00a000;">Full</b></td>
413413
</tr>
414414
<tr class="odd">

doc/faq.html

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ <h1>Frequently Asked Questions (FAQ)</h1>
5757
</li></ul>
5858
</div>
5959
<div id="main">
60-
<dl>
60+
<dl id="info">
6161
<dt>Q: Where can I learn more about LuaJIT and Lua?</dt>
6262
<dd>
6363
<ul style="padding: 0;">
@@ -77,7 +77,7 @@ <h1>Frequently Asked Questions (FAQ)</h1>
7777
</ul>
7878
</dl>
7979

80-
<dl>
80+
<dl id="tech">
8181
<dt>Q: Where can I learn more about the compiler technology used by LuaJIT?</dt>
8282
<dd>
8383
I'm planning to write more documentation about the internals of LuaJIT.
@@ -93,7 +93,7 @@ <h1>Frequently Asked Questions (FAQ)</h1>
9393
</dd>
9494
</dl>
9595

96-
<dl>
96+
<dl id="arg">
9797
<dt>Q: Why do I get this error: "attempt to index global 'arg' (a nil value)"?<br>
9898
Q: My vararg functions fail after switching to LuaJIT!</dt>
9999
<dd>LuaJIT is compatible to the Lua 5.1 language standard. It doesn't
@@ -103,7 +103,7 @@ <h1>Frequently Asked Questions (FAQ)</h1>
103103
vararg syntax</a>.</dd>
104104
</dl>
105105

106-
<dl>
106+
<dl id="x87">
107107
<dt>Q: Why do I get this error: "bad FPU precision"?<br>
108108
<dt>Q: I get weird behavior after initializing Direct3D.<br>
109109
<dt>Q: Some FPU operations crash after I load a Delphi DLL.<br>
@@ -125,7 +125,7 @@ <h1>Frequently Asked Questions (FAQ)</h1>
125125

126126
</dl>
127127

128-
<dl>
128+
<dl id="ctrlc">
129129
<dt>Q: Sometimes Ctrl-C fails to stop my Lua program. Why?</dt>
130130
<dd>The interrupt signal handler sets a Lua debug hook. But this is
131131
currently ignored by compiled code (this will eventually be fixed). If
@@ -136,7 +136,31 @@ <h1>Frequently Asked Questions (FAQ)</h1>
136136
running inside a C function under the Lua interpreter.</dd>
137137
</dl>
138138

139-
<dl>
139+
<dl id="sandbox">
140+
<dt>Q: Can Lua code be safely sandboxed?</dt>
141+
<dd>
142+
Maybe for an extremly restricted subset of Lua and if you relentlessly
143+
scrutinize every single interface function you offer to the untrusted code.<br>
144+
145+
Although Lua provides some sandboxing functionality (<tt>setfenv()</tt>, hooks),
146+
it's very hard to get this right even for the Lua core libraries. Of course,
147+
you'll need to inspect any extension library, too. And there are libraries
148+
that are inherently unsafe, e.g. the <a href="ext_ffi.html">FFI library</a>.<br>
149+
150+
Relatedly, <b>loading untrusted bytecode is not safe!</b> It's trivial
151+
to crash the Lua or LuaJIT VM with maliciously crafted bytecode. This is
152+
well known and there's no bytecode verification on purpose, so please
153+
don't report a bug about it. Check the <tt>mode</tt> parameter for the
154+
<tt>load*()</tt> functions to disable loading of bytecode.<br>
155+
156+
In general, the only promising approach is to sandbox Lua code at the
157+
process level and not the VM level.<br>
158+
159+
More reading material at the <a href="http://lua-users.org/wiki/SandBoxes"><span class="ext">&raquo;</span>&nbsp;Lua Wiki</a> and <a href="https://en.wikipedia.org/wiki/Sandbox_(computer_security)">Wikipedia</a>.
160+
</dd>
161+
</dl>
162+
163+
<dl id="patches">
140164
<dt>Q: Why doesn't my favorite power-patch for Lua apply against LuaJIT?</dt>
141165
<dd>Because it's a completely redesigned VM and has very little code
142166
in common with Lua anymore. Also, if the patch introduces changes to
@@ -147,7 +171,7 @@ <h1>Frequently Asked Questions (FAQ)</h1>
147171
The compiler will happily optimize away such indirections.</dd>
148172
</dl>
149173

150-
<dl>
174+
<dl id="arch">
151175
<dt>Q: Lua runs everywhere. Why doesn't LuaJIT support my CPU?</dt>
152176
<dd>Because it's a compiler &mdash; it needs to generate native
153177
machine code. This means the code generator must be ported to each
@@ -158,7 +182,7 @@ <h1>Frequently Asked Questions (FAQ)</h1>
158182
demand and/or sponsoring.</dd>
159183
</dl>
160184

161-
<dl>
185+
<dl id="when">
162186
<dt>Q: When will feature X be added? When will the next version be released?</dt>
163187
<dd>When it's ready.<br>
164188
C'mon, it's open source &mdash; I'm doing it on my own time and you're

0 commit comments

Comments
 (0)