]> git.baikalelectronics.ru Git - kernel.git/commit
xdp: Reset prog in dev_change_xdp_fd when fd is negative
authorDavid Ahern <dsahern@gmail.com>
Sun, 12 Apr 2020 13:32:04 +0000 (07:32 -0600)
committerDaniel Borkmann <daniel@iogearbox.net>
Tue, 14 Apr 2020 19:38:02 +0000 (21:38 +0200)
commit7b4cb240752bbfebd1c732b080bbd1650dc94415
treeabcec0eda77f457704330ae51338d22e98d656c9
parent025bcb16707d1c452c68cefda091e8fa99f7de28
xdp: Reset prog in dev_change_xdp_fd when fd is negative

The commit mentioned in the Fixes tag reuses the local prog variable
when looking up an expected_fd. The variable is not reset when fd < 0
causing a detach with the expected_fd set to actually call
dev_xdp_install for the existing program. The end result is that the
detach does not happen.

Fixes: f564fa77229a ("xdp: Support specifying expected existing program when attaching XDP")
Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Toke Høiland-Jørgensen <toke@redhat.com>
Link: https://lore.kernel.org/bpf/20200412133204.43847-1-dsahern@kernel.org
net/core/dev.c