summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorJakub Kicinski <jakub.kicinski@netronome.com>2019-11-01 06:07:00 +0300
committerDavid S. Miller <davem@davemloft.net>2019-11-02 01:16:01 +0300
commitaefc3e723a78c2e429a64dadd7815ef2a4aecd44 (patch)
treeb063451b5cf5c6ab727b3dfdf36f7763d4574f03 /security
parent41aa29a58b5f7f7be43f35372ef411f304a87a0d (diff)
downloadlinux-aefc3e723a78c2e429a64dadd7815ef2a4aecd44.tar.xz
net: fix installing orphaned programs
When netdevice with offloaded BPF programs is destroyed the programs are orphaned and removed from the program IDA - their IDs get released (the programs may remain accessible via existing open file descriptors and pinned files). After IDs are released they are set to 0. This confuses dev_change_xdp_fd() because it compares the __dev_xdp_query() result where 0 means no program with prog->aux->id where 0 means orphaned. dev_change_xdp_fd() would have incorrectly returned success even though it had not installed the program. Since drivers already catch this case via bpf_offload_dev_match() let them handle this case. The error message drivers produce in this case ("program loaded for a different device") is in fact correct as the orphaned program must had to be loaded for a different device. Fixes: c14a9f633d9e ("net: Don't call XDP_SETUP_PROG when nothing is changed") Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'security')
0 files changed, 0 insertions, 0 deletions