gobpf icon indicating copy to clipboard operation
gobpf copied to clipboard

"BPF_STX uses reserved fields" validation error when using __sync_lock_test_and_set

Open evilsocket opened this issue 3 years ago • 2 comments

Hi, in an eBPF program that i'm loading with gobpf I need to perform atomic increments and atomic set. For the first, I use __sync_fetch_and_add with no issues, however if I try to use __sync_lock_test_and_set for the latter, while compilation passes, I get a runtime error from the validator:

BPF_STX uses reserved fields
processed 0 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0

How do I perform atomic set of a variable so that i don't have to use PER_CPU arrays?

eBPF program compiled with clang 12.0.1, running on 5.8.0-53-generic ( x86_64 )

evilsocket avatar May 28 '21 13:05 evilsocket

@evilsocket any updates on this? did you find the problem?

sarsanaee avatar Jul 13 '22 15:07 sarsanaee

@sarsanaee nope, i've since migrated to https://github.com/aya-rs/aya

evilsocket avatar Jul 13 '22 17:07 evilsocket