aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/dev.c
diff options
context:
space:
mode:
authorStanislav Fomichev <[email protected]>2025-03-31 14:28:14 +0000
committerJakub Kicinski <[email protected]>2025-04-02 23:06:15 +0000
commitd996e412b2dfc079bd44bff5b3bc743fdb6d7c90 (patch)
tree49b16082bb217eb26bda6572646096d3a87325fc /net/core/dev.c
parentnet: airoha: Fix ETS priomap validation (diff)
downloadkernel-d996e412b2dfc079bd44bff5b3bc743fdb6d7c90.tar.gz
kernel-d996e412b2dfc079bd44bff5b3bc743fdb6d7c90.zip
bpf: add missing ops lock around dev_xdp_attach_link
Syzkaller points out that create_link path doesn't grab ops lock, add it. Reported-by: [email protected] Closes: https://lore.kernel.org/bpf/[email protected]/ Fixes: 97246d6d21c2 ("net: hold netdev instance lock during ndo_bpf") Signed-off-by: Stanislav Fomichev <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r--net/core/dev.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index be17e0660144..5d20ff226d5e 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -10284,7 +10284,9 @@ int bpf_xdp_link_attach(const union bpf_attr *attr, struct bpf_prog *prog)
goto unlock;
}
+ netdev_lock_ops(dev);
err = dev_xdp_attach_link(dev, &extack, link);
+ netdev_unlock_ops(dev);
rtnl_unlock();
if (err) {