Repository navigation
Conversation
A method a loop calls on a variable that a later pass sets to nil, or to another value, `p:getbyte(i)` in a loop that may write `p = nil`, compiled to a load through whatever word the register holds on that pass, a load the verifier refuses (check_mem_access, "invalid mem access 'scalar'"), where Lua raises. The call is refused at its line now: "'getbyte' takes the packet, not a packet that may be nil". The walk joins the method each pass reads at the call, and the join keeps the first pass's, whose receiver is the packet, while the register past it, which the call passes and the read goes through, holds the packet or nil. CALL holds that register to the method's receiver, as frame.same compares two values of the state, before it lowers the method. The kernel's answer is the verifier's refusal of a load through a register it does not know as a pointer, which the compiler gives at the line instead of an object that does not load. Every program file of Lunatik's tests/luaebpf, tests/tc and tests/xdp compiles to the same object. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A method called in a loop on a variable that a later iteration sets to nil, or to a number,
compiles today to an object the verifier refuses to load, "R3 invalid mem access 'scalar'", where
Lua would raise on the iteration after it.
lunatik bpfnow refuses such a call at its line, naming the method, what it takes and what thevariable may hold when it is called. Here, where
pis the packet on the first iteration and maybe nil after it, it says "'getbyte' takes the packet, not a packet that may be nil"; with
p = 1in place of
p = nil, "'getbyte' takes the packet, not a number that may be a packet". A loop that setsptoctx:packet()again compiles as it does today.doc/guide/08-luaebpf.md lists the first message among its refusals.
It needs no kernel and no build step of its own.