Open mtfriesen opened 1 year ago
@mtfriesen can you confirm if the step 2 in the repro steps above also unloaded the eBPF program B
, before moving to step 3?
If the test is unloading program B
step 2, can you try the following and see if it still reproduces?
B
(which was loaded in step 2) in step 3?Yup, I've updated the repro steps to include the bpf_object__close
between original steps 2 and 3.
Confirmed no issues issuing the two bpf_xdp_attach
calls directly in sequence, i.e. without closing the BPF object created in step (2) and reusing it for original step (3).
@shankarseal could this be prioritized? I am now needing to work around this eBPF bug in another project's test cases.
Can't make it in 2401
@Alan-Jowett -- can you make a short-term fix to return EBUSY for the scenario mentioned in this issue? I am moving this to 2408.
Still blocked on multi-program fix.
Describe the bug
If an application tries to open+load+attach the same native program immediately after it failed to attach, eBPF fails to load the program on the second attempt, seemingly because the first driver is still unloading.
Separately, the same native eBPF program cannot be loaded concurrently, but it's unclear whether that is by design.
OS information
20348.859.amd64fre.fe_release_svc_prod2.220707-1832
Steps taken to reproduce bug
A
(native or JIT) to an XDP interfaceB
to the same XDP interface - this will be rejected by XDPbpf_object__close
native programB
.B
to the same XDP interface usingXDP_FLAGS_REPLACE
Expected behavior
Attach (3) should succeed.
Actual outcome
Attach (3) fails unless the caller delays the thread between attach (2) and (3) long enough for the driver loaded during attach (2) to unload.
Additional details
ebpf_native_load_fail.log
Concrete code: