Skip to content

Commit d996e41

Browse files
Stanislav Fomichevkuba-moo
authored andcommitted
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: syzbot+08936936fe8132f91f1a@syzkaller.appspotmail.com Closes: https://lore.kernel.org/bpf/67e6b3e8.050a0220.2f068f.0079.GAE@google.com/ Fixes: 97246d6 ("net: hold netdev instance lock during ndo_bpf") Signed-off-by: Stanislav Fomichev <sdf@fomichev.me> Link: https://patch.msgid.link/20250331142814.1887506-1-sdf@fomichev.me Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 3675792 commit d996e41

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/core/dev.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10284,7 +10284,9 @@ int bpf_xdp_link_attach(const union bpf_attr *attr, struct bpf_prog *prog)
1028410284
goto unlock;
1028510285
}
1028610286

10287+
netdev_lock_ops(dev);
1028710288
err = dev_xdp_attach_link(dev, &extack, link);
10289+
netdev_unlock_ops(dev);
1028810290
rtnl_unlock();
1028910291

1029010292
if (err) {

0 commit comments

Comments
 (0)