On Tue, Nov 18, 2025 at 04:47:16PM +0100, Markus Armbruster wrote:
> Stubs in ebpf_rss-stub.c return false for failure without setting an
> Error.  This is wrong.  Callers may assume that the functions set an
> error when they fail, and crash when they try to examine or report the
> error.  Callers may also check the error instead of the return value,
> and misinterpret the failure as success.
> 
> ebpf_rss_load() and ebpf_rss_load() are reachable via
> virtio_net_load_ebpf().  Fix them to set an error.
> 
> ebpf_rss_set_all() is unreachable: it can only be called when the
> context has an eBPF program loaded, which is impossible with eBPF
> support compiled out.  Call abort() there to make that clear, and to
> get rid of the latent bug.
> 
> Fixes: 00b69f1d867d (ebpf: add formal error reporting to all APIs)
> Signed-off-by: Markus Armbruster <[email protected]>
> ---
>  ebpf/ebpf_rss-stub.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Reviewed-by: Daniel P. Berrangé <[email protected]>

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|


Reply via email to