* [PATCH bpf v2] netkit: Reject IFLA_NETKIT_PEER_INFO in netkit_change_link
@ 2023-11-27 20:05 Daniel Borkmann
2023-11-27 21:07 ` Jakub Kicinski
2023-11-28 0:30 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Daniel Borkmann @ 2023-11-27 20:05 UTC (permalink / raw)
To: martin.lau; +Cc: razor, bpf, netdev, Daniel Borkmann, Jakub Kicinski
The IFLA_NETKIT_PEER_INFO attribute can only be used during device
creation, but not via changelink callback. Hence reject it there.
Fixes: 35dfaad7188c ("netkit, bpf: Add bpf programmable net device")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
Cc: Jakub Kicinski <kuba@kernel.org>
---
v1 -> v2:
- Switch error code from EACCES to EINVAL (Jakub)
drivers/net/netkit.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/netkit.c b/drivers/net/netkit.c
index 97bd6705c241..39171380ccf2 100644
--- a/drivers/net/netkit.c
+++ b/drivers/net/netkit.c
@@ -851,6 +851,12 @@ static int netkit_change_link(struct net_device *dev, struct nlattr *tb[],
return -EACCES;
}
+ if (data[IFLA_NETKIT_PEER_INFO]) {
+ NL_SET_ERR_MSG_ATTR(extack, data[IFLA_NETKIT_PEER_INFO],
+ "netkit peer info cannot be changed after device creation");
+ return -EINVAL;
+ }
+
if (data[IFLA_NETKIT_POLICY]) {
attr = data[IFLA_NETKIT_POLICY];
policy = nla_get_u32(attr);
--
2.21.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH bpf v2] netkit: Reject IFLA_NETKIT_PEER_INFO in netkit_change_link
2023-11-27 20:05 [PATCH bpf v2] netkit: Reject IFLA_NETKIT_PEER_INFO in netkit_change_link Daniel Borkmann
@ 2023-11-27 21:07 ` Jakub Kicinski
2023-11-28 0:30 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Jakub Kicinski @ 2023-11-27 21:07 UTC (permalink / raw)
To: Daniel Borkmann; +Cc: martin.lau, razor, bpf, netdev
On Mon, 27 Nov 2023 21:05:33 +0100 Daniel Borkmann wrote:
> The IFLA_NETKIT_PEER_INFO attribute can only be used during device
> creation, but not via changelink callback. Hence reject it there.
>
> Fixes: 35dfaad7188c ("netkit, bpf: Add bpf programmable net device")
> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
> Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
> Cc: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH bpf v2] netkit: Reject IFLA_NETKIT_PEER_INFO in netkit_change_link
2023-11-27 20:05 [PATCH bpf v2] netkit: Reject IFLA_NETKIT_PEER_INFO in netkit_change_link Daniel Borkmann
2023-11-27 21:07 ` Jakub Kicinski
@ 2023-11-28 0:30 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-11-28 0:30 UTC (permalink / raw)
To: Daniel Borkmann; +Cc: martin.lau, razor, bpf, netdev, kuba
Hello:
This patch was applied to bpf/bpf.git (master)
by Martin KaFai Lau <martin.lau@kernel.org>:
On Mon, 27 Nov 2023 21:05:33 +0100 you wrote:
> The IFLA_NETKIT_PEER_INFO attribute can only be used during device
> creation, but not via changelink callback. Hence reject it there.
>
> Fixes: 35dfaad7188c ("netkit, bpf: Add bpf programmable net device")
> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
> Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
> Cc: Jakub Kicinski <kuba@kernel.org>
>
> [...]
Here is the summary with links:
- [bpf,v2] netkit: Reject IFLA_NETKIT_PEER_INFO in netkit_change_link
https://git.kernel.org/bpf/bpf/c/0bad281d0ecd
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] 3+ messages in thread
end of thread, other threads:[~2023-11-28 0:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-27 20:05 [PATCH bpf v2] netkit: Reject IFLA_NETKIT_PEER_INFO in netkit_change_link Daniel Borkmann
2023-11-27 21:07 ` Jakub Kicinski
2023-11-28 0:30 ` 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).