Re: [PATCH bpf-next] net: Don't uninstall an XDP program when none is installed

2019-07-12 Thread Daniel Borkmann
On 07/10/2019 01:16 PM, Maxim Mikityanskiy wrote: > On 2019-06-12 19:14, Maxim Mikityanskiy wrote: >> dev_change_xdp_fd doesn't perform any checks in case it uninstalls an >> XDP program. It means that the driver's ndo_bpf can be called with >> XDP_SETUP_PROG asking to set it to NULL even if it's a

Re: [PATCH bpf-next] net: Don't uninstall an XDP program when none is installed

2019-07-10 Thread Maxim Mikityanskiy
On 2019-06-12 19:14, Maxim Mikityanskiy wrote: > dev_change_xdp_fd doesn't perform any checks in case it uninstalls an > XDP program. It means that the driver's ndo_bpf can be called with > XDP_SETUP_PROG asking to set it to NULL even if it's already NULL. This > case happens if the user runs `ip l

Re: [PATCH bpf-next] net: Don't uninstall an XDP program when none is installed

2019-06-13 Thread Jakub Kicinski
On Thu, 13 Jun 2019 11:04:45 +0200, Björn Töpel wrote: > > > + } else { > > > + if (!__dev_xdp_query(dev, bpf_op, query)) > > > + return 0; > > > > This will mask the error if program is installed with different flags. > > > > Hmm, probably missing something

Re: [PATCH bpf-next] net: Don't uninstall an XDP program when none is installed

2019-06-13 Thread Björn Töpel
On Wed, 12 Jun 2019 at 23:15, Jakub Kicinski wrote: > > On Wed, 12 Jun 2019 16:14:18 +, Maxim Mikityanskiy wrote: > > dev_change_xdp_fd doesn't perform any checks in case it uninstalls an > > XDP program. It means that the driver's ndo_bpf can be called with > > XDP_SETUP_PROG asking to set it

Re: [PATCH bpf-next] net: Don't uninstall an XDP program when none is installed

2019-06-12 Thread Jakub Kicinski
On Wed, 12 Jun 2019 16:14:18 +, Maxim Mikityanskiy wrote: > dev_change_xdp_fd doesn't perform any checks in case it uninstalls an > XDP program. It means that the driver's ndo_bpf can be called with > XDP_SETUP_PROG asking to set it to NULL even if it's already NULL. This > case happens if the

Re: [PATCH bpf-next] net: Don't uninstall an XDP program when none is installed

2019-06-12 Thread Björn Töpel
On 2019-06-12 18:14, Maxim Mikityanskiy wrote: dev_change_xdp_fd doesn't perform any checks in case it uninstalls an XDP program. It means that the driver's ndo_bpf can be called with XDP_SETUP_PROG asking to set it to NULL even if it's already NULL. This case happens if the user runs `ip link se