Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/net/bpf: disassemble load extension to type LoadExtension #18469

breml opened this issue Dec 29, 2016 · 2 comments

x/net/bpf: disassemble load extension to type LoadExtension #18469

breml opened this issue Dec 29, 2016 · 2 comments


Copy link

@breml breml commented Dec 29, 2016

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version go1.7.4 linux/amd64

What operating system and processor architecture are you using (go env)?

linux, amd64

What did you do?

Disassemble bpf instructions including ld rand (load bpf extension rand).

What did you expect to see?

ld rand should be disassembled to bpf.LoadExtension{Num:56}.

What did you see instead?

ld rand was disassembled to bpf.LoadAbsolute{Off:0xfffff038, Size:4}.

CC: @danderson, @mikioh, @mdlayher

Copy link

@gopherbot gopherbot commented Dec 29, 2016

CL mentions this issue.

Copy link

@mdlayher mdlayher commented Dec 29, 2016

Nice, thanks for the quick CL. Unfortunately, I'm not well-versed in the assembly and disassembly portions, so I'll leave this for @danderson and @mikioh.

@rsc rsc added this to the Unreleased milestone Jan 4, 2017
@golang golang locked and limited conversation to collaborators Jan 7, 2018
NET12115 added a commit to NET12115/Golang-C-NET that referenced this issue Feb 28, 2022
Load extension in BPF is an overload of the load absolute
instruction with a 'negative offset'. Disassemble load
absolute instructions to load extension, if the offset
is 'negative', respectively > (0xFFFFFFFF - 0x1000).

Fixes golang/go#18469

Change-Id: I13af8f5af89ce26b13a35d2b06879dd6e1c7434e
Run-TryBot: Mikio Hara <>
TryBot-Result: Gobot Gobot <>
Reviewed-by: Mikio Hara <>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet

No branches or pull requests

4 participants