* [PATCH bpf] bpf: add missing ops lock around dev_xdp_attach_link
@ 2025-03-31 14:28 Stanislav Fomichev
2025-04-01 10:33 ` Paolo Abeni
2025-04-02 23:40 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 5+ messages in thread
From: Stanislav Fomichev @ 2025-03-31 14:28 UTC (permalink / raw)
To: bpf, netdev
Cc: ast, daniel, andrii, martin.lau, song, yhs, john.fastabend,
kpsingh, haoluo, jolsa, linux-kernel, davem, edumazet, kuba,
pabeni, horms, hawk, sdf, syzbot+08936936fe8132f91f1a
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH bpf] bpf: add missing ops lock around dev_xdp_attach_link
2025-03-31 14:28 [PATCH bpf] bpf: add missing ops lock around dev_xdp_attach_link Stanislav Fomichev
@ 2025-04-01 10:33 ` Paolo Abeni
2025-04-01 15:05 ` Alexei Starovoitov
2025-04-02 23:40 ` patchwork-bot+netdevbpf
1 sibling, 1 reply; 5+ messages in thread
From: Paolo Abeni @ 2025-04-01 10:33 UTC (permalink / raw)
To: Stanislav Fomichev, bpf, netdev
Cc: ast, daniel, andrii, martin.lau, song, yhs, john.fastabend,
kpsingh, haoluo, jolsa, linux-kernel, davem, edumazet, kuba,
horms, hawk, syzbot+08936936fe8132f91f1a
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH bpf] bpf: add missing ops lock around dev_xdp_attach_link
2025-04-01 10:33 ` Paolo Abeni
@ 2025-04-01 15:05 ` Alexei Starovoitov
2025-04-01 16:39 ` Stanislav Fomichev
0 siblings, 1 reply; 5+ messages in thread
From: Alexei Starovoitov @ 2025-04-01 15:05 UTC (permalink / raw)
To: Paolo Abeni
Cc: Stanislav Fomichev, bpf, Network Development, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau, Song Liu,
Yonghong Song, John Fastabend, KP Singh, Hao Luo, Jiri Olsa, LKML,
David S. Miller, Eric Dumazet, Jakub Kicinski, Simon Horman,
Jesper Dangaard Brouer, syzbot+08936936fe8132f91f1a
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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH bpf] bpf: add missing ops lock around dev_xdp_attach_link
2025-04-01 15:05 ` Alexei Starovoitov
@ 2025-04-01 16:39 ` Stanislav Fomichev
0 siblings, 0 replies; 5+ messages in thread
From: Stanislav Fomichev @ 2025-04-01 16:39 UTC (permalink / raw)
To: Alexei Starovoitov
Cc: Paolo Abeni, Stanislav Fomichev, bpf, Network Development,
Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
Martin KaFai Lau, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Hao Luo, Jiri Olsa, LKML, David S. Miller, Eric Dumazet,
Jakub Kicinski, Simon Horman, Jesper Dangaard Brouer,
syzbot+08936936fe8132f91f1a
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)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH bpf] bpf: add missing ops lock around dev_xdp_attach_link
2025-03-31 14:28 [PATCH bpf] bpf: add missing ops lock around dev_xdp_attach_link Stanislav Fomichev
2025-04-01 10:33 ` Paolo Abeni
@ 2025-04-02 23:40 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-04-02 23:40 UTC (permalink / raw)
To: Stanislav Fomichev
Cc: bpf, netdev, ast, daniel, andrii, martin.lau, song, yhs,
john.fastabend, kpsingh, haoluo, jolsa, linux-kernel, davem,
edumazet, kuba, pabeni, horms, hawk, syzbot+08936936fe8132f91f1a
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Mon, 31 Mar 2025 07:28:14 -0700 you 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>
>
> [...]
Here is the summary with links:
- [bpf] bpf: add missing ops lock around dev_xdp_attach_link
https://git.kernel.org/netdev/net/c/d996e412b2df
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-04-02 23:39 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-31 14:28 [PATCH bpf] bpf: add missing ops lock around dev_xdp_attach_link Stanislav Fomichev
2025-04-01 10:33 ` Paolo Abeni
2025-04-01 15:05 ` Alexei Starovoitov
2025-04-01 16:39 ` Stanislav Fomichev
2025-04-02 23:40 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).