netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Strange samples/bpf loading error for maps on net-next?
@ 2017-04-27 11:15 Jesper Dangaard Brouer
  2017-04-28  5:49 ` Alexei Starovoitov
  0 siblings, 1 reply; 7+ messages in thread
From: Jesper Dangaard Brouer @ 2017-04-27 11:15 UTC (permalink / raw)
  To: Daniel Borkmann, Martin KaFai Lau; +Cc: brouer, netdev@vger.kernel.org


To provoke this bug, remember that you MUST call:

 make headers_install

In the kernels root directory, else you will be compiling samples/bpf/
against the older headers previously installed.

The error looks like:

 $ sudo ./sockex1
 bpf_load_program() err=22
 fd 0 is not pointing to valid bpf_map
 sockex1: [...]/samples/bpf/sockex1_user.c:26: main: Assertion `setsockopt(sock, SOL_SOCKET, SO_ATTACH_BPF, prog_fd, sizeof(prog_fd[0])) == 0' failed.
 Aborted

I've found that the bug were introduced in
 commit: fb30d4b71214 ("bpf: Add tests for map-in-map")

-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  LinkedIn: http://www.linkedin.com/in/brouer

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-05-01  2:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-27 11:15 Strange samples/bpf loading error for maps on net-next? Jesper Dangaard Brouer
2017-04-28  5:49 ` Alexei Starovoitov
2017-04-28  6:28   ` Jesper Dangaard Brouer
2017-04-28 14:25     ` [net-next PATCH V1] samples/bpf: bpf_load.c detect and abort if ELF maps section size is wrong Jesper Dangaard Brouer
2017-04-29  3:35       ` Alexei Starovoitov
2017-04-29  7:57         ` Jesper Dangaard Brouer
2017-05-01  2:43       ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).