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.
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).
Fixesgolang/go#18469
Change-Id: I13af8f5af89ce26b13a35d2b06879dd6e1c7434e
Reviewed-on: https://go-review.googlesource.com/34771
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 tobpf.LoadExtension{Num:56}
.What did you see instead?
ld rand
was disassembled tobpf.LoadAbsolute{Off:0xfffff038, Size:4}
.CC: @danderson, @mikioh, @mdlayher
The text was updated successfully, but these errors were encountered: