Leveraging Userspace to Safely Run Untrusted Lua
summary
Lua interpreter and compiler run entirely in MPU-backed userspace on Zephyr, with custom libc/math shims and a user-space allocator; bytecode is compiled in userland and debug info stripped. A working prototype on an nrf52840 demo controls RGB LEDs over Web Bluetooth, accepts text script uploads, and hits about 4.2 kHz callback rates. Flash cost is roughly 50 KB and RAM per interpreter is on the order of 12–13 KB; sandboxing prevents device-bricking.
AI-written summary · about
chapters (9)
- 0:00Start
- 2:40Challenge: Constraints
- 3:54Approaches: Custom configuration scheme
- 5:21Approaches: MicroPython
- 6:47Approaches: Lua
- 10:18Building Lua for Zephyr
- 12:09Building Lua for Userspace
- 14:39Using Lua in Userspace
- 18:00Using Lua for cool stuff
related talks
41mUserspace in Zephyr: Overview and Practicality
41mUserspace in Zephyr: Overview and Practicality
35mZephyr OS Memory Protection
35mZephyr OS Memory Protection
37mImplement Safety with a RTOS Running as a Linux Companion Within...
41mTurning the Ignition on Safety: Zephyr RTOS in Automotive Compliance
39mExtending Zephyr Based Applications at Runtime with LLEXT
27mMay the Trust be with You: Empowering TrustZone-M with Multiple Trusted Environments
