Lunatik v4.2
Lunatik 4.2
New Modules
- luaskb: wraps
struct sk_bufffor direct packet manipulation from Lua —skb:data([layer]),skb:forward(),skb:copy(),skb:resize(n),skb:ifindex(),skb:vlan(), with IPv6 checksum support;skb:copy()guards against FRAGLIST GSO skbs - darken + lighten: AES-256-CTR encrypted Lua script support —
darken(C module) decrypts and executes scripts in-kernel;lighten(Lua) provides the high-level interface
API Changes
lunatik.runtime(script, context): thesleepboolean parameter is now a context string —"softirq"replacesfalsefor non-sleepable runtimes; CLI:lunatik run <script> softirqdata.new(size, mode): new optionalmodeparameter ("single","shared") controls object sharing semanticsdata:checksum(): new method — raw IP checksum over the data buffer;luadata_resetno longer takes an offset parametersocket.unix: rewritten from a dynamic factory pattern to explicit OOP-style classes (unix.stream,unix.dgram) with full method set; tests addedlunatik_opt_t(C API): new bitmask type replaces thebool sleepandbool sharedparameters throughout the API —lunatik_runtime(),lunatik_newobject(),lunatik_createobject(), andlunatik_class_tall takelunatik_opt_tnow; flags:LUNATIK_OPT_SOFTIRQ(non-sleepable),LUNATIK_OPT_MONITOR(spinlock serialization),LUNATIK_OPT_SINGLE(no monitor overhead for per-object instances),LUNATIK_OPT_EXTERNAL(externally-owned pointer)luarcu(C API): entries now storelunatik_value_t(tagged union) instead of raw object pointers — supports nil, boolean, integer, and Lunatik objects as values
CLI and REPL
- Full REPL rewrite: multi-line input, readline support, expression auto-detection, multiple return values
- New
lunatik test [suite]command - Argument validation for
run/spawn/stop - Globals and runner state now initialized correctly when modules are pre-loaded (e.g., via
modprobeat boot) without callinglunatik loadfirst
Bug Fixes
- Fix GC finalizers running under spinlock in
lunatik_monitor(scheduling-while-atomic crash) - Fix opaque error messages in
lunatik_monitor— errors now include method name and Lua traceback - Fix module refcount leak on runtime error path
- Fix
shouldstop()crash when called outside kthread context - Fix
thread.runerror during module load
Removed
luaxtablemodule removed
Examples
- New
tcpreject: TCP RST injection via netfilter mark, with IPv6 support
Tests
- KTAP shell framework introduced for all test suites
- New regression tests: GC-under-spinlock,
rcu_shared,resume_shared,shouldstop, spawn-during-module-load,opt_guards,opt_skb_single - New socket/unix test suites (STREAM and DGRAM)
Contributors
Thank you to everyone who contributed to this release:
- @sneaky-potato — opaque error messages in
lunatik_monitor, non-shared objects in shared class, remove Lua traceback fromlunatik_fixerror, README fix - @carloslack —
data:checksum()(raw IP checksum),skb:vlan(), removed unneeded includes - @Suryansh-Dey — fix
sockaddrversion guard (first contribution! 🎉)
Full Changelog: v4.1.1...v4.2