Repository navigation
Lunatik v5.1
Lunatik 5.1 gives each linux.* table one kernel family, names the IP-level socket options, runs compiled chunks under darken, and serves the documentation of the latest release beside master's. It fixes the monitor every shared object's methods run through, netlink sends from interrupt context, a crypto rng that could not be created and autogen on 32-bit ARM, and make install no longer leaves behind what the tree dropped. Scripts written for 5.0 that read a renamed table need the changes listed under Changes to existing APIs.
Highlights
- IP-level socket options:
linux.socket.ipnames the fortyIP_*options the setsockopt and getsockopt ofnet/ipv4/ip_sockglue.ctake, which a script spelled as literals (#1835). - Compiled chunks under darken:
darken.runruns a chunklunaticcompiled, asrequiredoes, so a product can ship its scripts encrypted and compiled at once (#1767);darken.loadandlighten.loaddecrypt and load a script without running it, andtools/shade.shwrites the dark script as a tail call of it, so an encrypted module nests no deeper on the kernel stack than a plain one (#1768). - Documentation: the site serves the latest release at its root, the newest of each earlier line from 5.0 under its version,
5.0/, and master undermaster/, each built from its own tag, and every page's switch lists them (#1781, #1881).
Fixes
- Monitored methods, which every shared object's methods run through: a script's
collectgarbage("stop")held only until its first monitored call, which restarted the collector (#1817); a resumed runtime that raisedready?reached the caller ofresumeasreadyresume, every?of the message renamed (#1867); a call or return hook set withdebug.sethookran the script's hook function under the object's lock, where one that slept scheduled while atomic, one that closed the object waited on the lock its own task held, and an error object one raised reached the monitor's rewrite of the message (#1879). - Netlink from interrupt context (#1742): a hardirq runtime's probe handler, or a softirq runtime's callback run with IRQs off, as a hid callback behind a USB host controller without
HCD_BHis, could send on anetlink.channeland, with an nlmon tap up, re-enable bottom halves with IRQs off;netlink.channel.newrefuses a hardirq runtime (#1818), andmulticastandunicastrefuse with IRQs disabled (#1863). - netfilter:
registeraccepted an options table whose callback was missing or misspelled, and each packet the hook saw was accepted with "operation not defined" in the log; it now raisesbad field 'hook' (function expected, got <type>)(#1823). - crypto:
crypto.rng(name)andrng:reset()without a seed seed withseedsize()random bytes, so an algorithm whose seed size is not 0,ansi_cprngamong them, can be created (#1822). - 32-bit ARM: autogen reads the constants 32-bit ARM prints after
#, where everylinux.*table came out empty and every struct layout had size 0 (#1821). - Installs:
make installinstalls the modules the build made and thelinux.*tables the specs generate, and removes what an earlier install left in the directories it owns, where a module or a file the tree renamed or dropped kept loading (#1838, #1845). - Build: every module declares a
MODULE_DESCRIPTION, whose absence modpost warns about on every build from 6.15 (#1801). - Examples: dnsblock blocks
example.netby default instead of GitHub and GitLab (#1809); ifquarantine serves each open a snapshot, so an event between two reads no longer tears a line (#1803); dnsdoctor keeps a symlinked/etc/resolv.confa symlink (#1804). - Tests: the suite skips the packet socket's network order case on a big-endian host (#1795) and the netlink route and rule cases on a kernel without IPv4 policy routing (#1798), and the unix socket clients bound their receive, so a silent server fails its case instead of hanging the suite (#1800).
Before upgrading
- Lunatik supports Linux 6.6 and later.
- The
linux.*names listed under Changes to existing APIs moved with no alias, and a script left on an old name reads nil, often silently:raw.new(eth.LLDP)on the oldlinux.ethbinds every protocol,signal.killgiven a namelinux.signalno longer holds sendsKILL, andlinux.schedulegiven onelinux.taskno longer holds sleepsINTERRUPTIBLE(#1837). make installremoveskernel/lunatikin the module tree, and thelinux,lunatik,socket,netlink,syscall,crypto,bpfandskbdirectories under/lib/modules/lua, before it writes them: a file of your own placed there is removed (#1838, #1845).- A chunk whose functions nest more than ten deep is out of contract for the kernel's stack (#1786).
- 32-bit ARM: the OpenWrt build still fails on missing division helpers (#418).
- On Linux 7.1 and later,
luacrypto.koloads only on a kernel that builds a user of the crypto rng API, such asCONFIG_CRYPTO_DRBG(#1415). xdpandtcbuilt without the running kernel's BTF (make btf_installbeforemake) load with their kfunc unregistered andmissing module BTFin the log, and an eBPF program that calls the kfunc then fails to load (#1607).
Changes to existing APIs
- linux.* (#1826, #1829, #1831, #1833, #1834, #1837): one kernel family per table.
linux.netlink.ALIGNTOislinux.netlink.align.ALIGNTO;linux.rtnetlink.iffislinux.iff;linux.pkttypeislinux.packet.type; theANY,NOEXISTandEXISToflinux.bpfarelinux.bpf.update;linux.scxislinux.scx.dsqandlinux.scx.slice; the ethertypes arelinux.eth.proto, the netdevice eventslinux.netdev.cmdand the vt notifier eventslinux.vt.event;linux.signalholds the signals only andlinux.taskthe task states only. - netlink (#1818, #1863):
netlink.channel.newraises in a hardirq runtime, andmulticastandunicastraise with IRQs disabled. - netfilter (#1823):
registerraises on an options table whosehookis not a function. - Debug hooks (#1879): a call or return hook sees a monitored method's wrapper call and return in place of the method's own, and one that also counts instructions restarts its countdown at each monitored call.
Known issues
Each is tracked in the issue it names, and the documentation of its module names the first four:
- A sched_ext callback runs under its CPU's runqueue lock, where
print, a completion'scompleteor a mailbox'ssendcan hang the CPU (#1718). - A netdevice callback's
STOPorBADon an event the kernel does not veto stops the chain (#1739). - An
rcutable a probe handler writes deadlocks against a writer that holds it with interrupts on (#1740). - A probe handler runs Lua in NMI, where its allocation can take a lock its CPU holds (#1741).
skb:data()andskb:resize()write into a head a clone shares (#1260).
Contributors
Lourival Vieira Neto (@lneto).
Full Changelog: v5.0...v5.1