[cap-talk] Lua, Javascript, and the Object Capability Model
James Graves
ansible at xnet.com
Sat Jul 25 23:55:28 EDT 2009
Mike Samuel <mikesamuel at gmail.com> wrote:
> "So you can set a limit on the number of bytecodes a Lua routine uses."
>
> A piece of malicious code in a restricted execution environment could
> still busy loop to run out its callers quota and another piece of
> malicious code might then be able to observe an object in an
> inconsistent state.
Well, the caller could give a lower limit to the malicious code to
prevent an inconsistent state in itself. I'd expect that in general
we'd want to inform the code how many instruction cycles it is allowed
to use... or is that a security problem?
The debug hooks can be set in Lua code, not just in C code. However,
with the current implementation, there seems to be an issue with how
continuations are handled. When a continuation is resumed, the
instruction counter set set to zero again. I'm investigating this
now, and there are probably a couple different ways this could be
fixed.
BR,
James
More information about the cap-talk
mailing list