Repository navigation
Highlights
- luaebpf, the Lua to eBPF compiler, has a repository of its own. Lunatik mounts it at
luaebpf/and this release carries luaebpf v0.1, whose documentation is at luainkernel.github.io/luaebpf.lunatik bpfcompiles a program file into a BPF object andlunatik run --devloads, attaches and pins it (#2030, #946, #2708, #2710). - Cryptography:
crypto.sigverifies a signature with the kernel's ECDSA and RSA, so a script needs no userspace check (#1940);crypto.kppagrees an ECDH secret in the kernel (#2360);crypto.compserves every kernel over acomp (#2493); andshashandskcipherserve softirq runtimes, for keys a hook derives per packet (#2378). - Sets: one type, built from a list or a map, whose match answers the longest member (#1903);
set.fromdatabuilds a set over the bytes of adata, andset.imagereads a set image in Lua and builds the set over it (#1917). - Structs: a
structcodec reads a struct's fields in place through a view, big-endian fields in host order and bitfields by name (#2641);bpf.mapreads and writes a struct value by field name (#1984). - Packets:
skb:hash()reads the flow hash the skb carries, so a script keys its state per flow (#1996);skb:ifname()names the device the packet holds (#2083);skb:checksum()finds the TCP or UDP header from the IP header wherever the hook sees the packet (#2334) and writes the sum the stack completes on a packet whose checksum is still pending (#2328);skb:data()reads a tc callback's non-linear skb (#2484); an XDPctxreads the device and receive queue the packet arrived on (#1993); andnetfilter.registertakes a mask on the mark, so hooks can each own a field of it (#2056). - Time and randomness:
linux.time([clock])reads MONOTONIC and BOOTTIME, which a wall clock step does not move (#2062), andlinux.random(m, n)draws uniformly from any interval (#2347, #2404). - sched_ext: an example schedules a workload through sched_ext (#2553); in an scx callback,
printandwarnwrite deferred (#2605), an allocation does not wake kswapd (#2631), a free does not hang its CPU (#2630), and the runqueue lock is marked per CPU (#2596). - 32-bit x86:
lunatik.kobuilds there, and Lua's%is right for a negative divisor (#2132, #2150). - Documentation: the site's pages fit a phone and its grey text meets WCAG AA contrast (#2712).
Fixes
- A copy of an skb drops its route, its conntrack entry and its skb extensions, so a namespace's teardown neither waits on a script nor leaves anything freed for it to read (#2177, #2178, #2183); a copy reads its hook's device while the callback runs, and none once it returns (#2099).
skb:forward()refuses a copy whose device encrypts the original by MACsec offload, lets through one it sends out of a MACsec device, and sends a copy whose head is its own, so a later write misses the sent frame (#2183, #2189, #2350);data(),resize()andchecksum()write into a head of the skb's own, not one a clone shares (#2355); in a tc callbackchecksum()refuses a non-linear skb (#2527).setcompares a key over its whole length, not its low 32 bits, and the empty set allocates nothing (#1932).fifotakes its buffer from the runtime's allocator, so a fragmented system still serves it (#1922).- The core returns a vmalloc'd block freed in atomic context on a worker, which holds the core module until it runs (#1925, #2604);
lunatik_closeobjectraises with IRQs disabled (#1936); the monitor steps the collector after a method that grew the heap (#2335); a deferred release reads no freed memory (#2686);lunatik_runpublishes its environment under RCU (#1976); a kfunc callback gets a copy of its ctx (#2114). rcuinitialises its table's SRCU at module load (#2634);lunatik.koandzfs.koload beside each other (#2662).fsnotifyreads the callback's verdict as the 64-bit value it is (#2294).device.newrefuses an empty name before the kernel WARNs on it, and uses the driver's name as given (#2304, #2288).hidreadsreport_fixup's return type fromstruct hid_driver(#2120), andhid.register's andnotifier's callbacks run on the body's task (#2498).socketbind and connect pass the address type their own prototype takes, which 6.18.57 changed for bind (#2095);linux.sockettakes the architecture's values where it has its ownasm/socket.h(#2260).crypto.kpprefuses a peer's point off the curve before any driver sees it, raises a driver's EINVAL, and raises EIO for an engine's status (#2463, #2504, #2500); a crypto class, anddarken, raise EOPNOTSUPP where the kernel builds no API for them, so their modules still load (#2385, #2523);luacryptois a module whereCRYPTO_RNG2is one, socrypto.rnglinks (#2516).netfilter: a percpu runtime registers again a hook it stopped (#2340).lunatik unloadandlistwork on modulesmodprobeloaded, andmodprobe lunatik_runloadsluadevicefirst (#2647).- Examples:
dnsdoctorrecomputes the UDP checksum of a response it rewrote and walks the answers by their RDLENGTH (#2439, #2444);dnsblockand the other examples log a name with its control bytes as "?" (#2407, #2417);tcpreject's cleanup puts forwarding back to what its setup found (#2277, #2400);sniclassify's cleanup unpins on a deleted device (#2677).
Before upgrading
- A checkout of Lunatik now mounts two repositories,
harness/andluaebpf/: after a clone or a pull,git submodule update --initfills them (#2706, #2708, #2710). - On a kernel built with
CONFIG_PREEMPT_RT, a hardirq runtime is refused, since a spinlock sleeps there (#2616).
Changes to existing APIs
set.newtakes a list of strings or a map from each member to a 32-bit label, andset:matchanswers the label of the longest member it ends in;set.labeledgoes (#1903).netfilter.registertakes an optional mask beside the mark; without one it is the whole mark, as before (#2056).linux.timetakes an optional clock fromlinux.clock; without one it reads the real time, as before (#2062).
Known issues
- On a kernel built with
CONFIG_PREEMPT_RT, a percpu softirq set takes a sleeping lock with preemption off (#2610). skb:checksum()writes a TCP or UDP check into an IPv4 fragment other than the first (#2321).examples/tcpreject's cleanup leaves forwarding on after a setup that failed (#2676).
Contributors
- Lourival Vieira Neto (@lneto)
- Ashwani Kumar Kamal (@sneaky-potato)
- jperon (@jperon)
- Ishanni (@ishanniselva-collab), whose first contribution names the protocols of the raw socket's usage example (#2668)
Full Changelog: v5.1...v5.2