> My main conclusion is that it's
> gotten a lot harder, and a complete verifier would likely be as big as
> (if not larger than) the luaV_execute core loop.
A complete verifier is a hopeless task (halting problem etc.).
We dropped even the simple integrity test in Lua 4.0, way back in 2000.
> Many 5.1/5.2 validators relied on luaP_opmodes to handle most opcodes
> generically, with a switch/case only covering the more complex cases.
We did that for bytecode listing in luac.c, but it was not clear.
Since Lua 5.4 luac.c uses a complete switch; it's much easier to
maintain even if there is much repetition.
> It's clear that bytecode validation isn't a priority for the community,
It's an impossible task.
Our take is that if you don't trust bytecode, don't allow Lua to load it.
--lhf