net/core/dev.c | 2 ++ 1 file changed, 2 insertions(+)
Syzkaller points out that create_link path doesn't grab ops lock,
add it.
Cc: Jakub Kicinski <kuba@kernel.org>
Reported-by: syzbot+08936936fe8132f91f1a@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/bpf/67e6b3e8.050a0220.2f068f.0079.GAE@google.com/
Fixes: 97246d6d21c2 ("net: hold netdev instance lock during ndo_bpf")
Signed-off-by: Stanislav Fomichev <sdf@fomichev.me>
---
net/core/dev.c | 2 ++
1 file changed, 2 insertions(+)
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) {
--
2.48.1
On 3/31/25 4:28 PM, Stanislav Fomichev wrote:
> Syzkaller points out that create_link path doesn't grab ops lock,
> add it.
>
> Cc: Jakub Kicinski <kuba@kernel.org>
> Reported-by: syzbot+08936936fe8132f91f1a@syzkaller.appspotmail.com
> Closes: https://lore.kernel.org/bpf/67e6b3e8.050a0220.2f068f.0079.GAE@google.com/
> Fixes: 97246d6d21c2 ("net: hold netdev instance lock during ndo_bpf")
> Signed-off-by: Stanislav Fomichev <sdf@fomichev.me>
LGTM, but are there any special reasons to get this via the bpf tree? It
looks like 'net' material to me?!?
Thanks,
Paolo
On Tue, Apr 1, 2025 at 3:33 AM Paolo Abeni <pabeni@redhat.com> wrote:
>
> On 3/31/25 4:28 PM, Stanislav Fomichev wrote:
> > Syzkaller points out that create_link path doesn't grab ops lock,
> > add it.
> >
> > Cc: Jakub Kicinski <kuba@kernel.org>
> > Reported-by: syzbot+08936936fe8132f91f1a@syzkaller.appspotmail.com
> > Closes: https://lore.kernel.org/bpf/67e6b3e8.050a0220.2f068f.0079.GAE@google.com/
> > Fixes: 97246d6d21c2 ("net: hold netdev instance lock during ndo_bpf")
> > Signed-off-by: Stanislav Fomichev <sdf@fomichev.me>
>
> LGTM, but are there any special reasons to get this via the bpf tree? It
> looks like 'net' material to me?!?
Pls take it through net.
On 04/01, Alexei Starovoitov wrote:
> On Tue, Apr 1, 2025 at 3:33 AM Paolo Abeni <pabeni@redhat.com> wrote:
> >
> > On 3/31/25 4:28 PM, Stanislav Fomichev wrote:
> > > Syzkaller points out that create_link path doesn't grab ops lock,
> > > add it.
> > >
> > > Cc: Jakub Kicinski <kuba@kernel.org>
> > > Reported-by: syzbot+08936936fe8132f91f1a@syzkaller.appspotmail.com
> > > Closes: https://lore.kernel.org/bpf/67e6b3e8.050a0220.2f068f.0079.GAE@google.com/
> > > Fixes: 97246d6d21c2 ("net: hold netdev instance lock during ndo_bpf")
> > > Signed-off-by: Stanislav Fomichev <sdf@fomichev.me>
> >
> > LGTM, but are there any special reasons to get this via the bpf tree? It
> > looks like 'net' material to me?!?
>
> Pls take it through net.
SG! LMK if I should repost to make it happen. (it's always hard for me,
with xdp, to figure out the proper tree)
© 2016 - 2025 Red Hat, Inc.