* [PATCH net] phonet: fix rtm_phonet_notify() skb allocation
@ 2024-05-02 16:17 Eric Dumazet
2024-05-02 17:34 ` Rémi Denis-Courmont
2024-05-07 2:00 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Eric Dumazet @ 2024-05-02 16:17 UTC (permalink / raw)
To: David S . Miller, Jakub Kicinski, Paolo Abeni
Cc: netdev, eric.dumazet, Eric Dumazet, Remi Denis-Courmont
fill_route() stores three components in the skb:
- struct rtmsg
- RTA_DST (u8)
- RTA_OIF (u32)
Therefore, rtm_phonet_notify() should use
NLMSG_ALIGN(sizeof(struct rtmsg)) +
nla_total_size(1) +
nla_total_size(4)
Fixes: f062f41d0657 ("Phonet: routing table Netlink interface")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Remi Denis-Courmont <courmisch@gmail.com>
---
net/phonet/pn_netlink.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/phonet/pn_netlink.c b/net/phonet/pn_netlink.c
index 59aebe29689077bfa77d37516aea4617fe3b8a50..dd4c7e9a634fbe29645107de04a90688cdfb1a01 100644
--- a/net/phonet/pn_netlink.c
+++ b/net/phonet/pn_netlink.c
@@ -193,7 +193,7 @@ void rtm_phonet_notify(int event, struct net_device *dev, u8 dst)
struct sk_buff *skb;
int err = -ENOBUFS;
- skb = nlmsg_new(NLMSG_ALIGN(sizeof(struct ifaddrmsg)) +
+ skb = nlmsg_new(NLMSG_ALIGN(sizeof(struct rtmsg)) +
nla_total_size(1) + nla_total_size(4), GFP_KERNEL);
if (skb == NULL)
goto errout;
--
2.45.0.rc0.197.gbae5840b3b-goog
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net] phonet: fix rtm_phonet_notify() skb allocation
2024-05-02 16:17 [PATCH net] phonet: fix rtm_phonet_notify() skb allocation Eric Dumazet
@ 2024-05-02 17:34 ` Rémi Denis-Courmont
2024-05-07 2:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Rémi Denis-Courmont @ 2024-05-02 17:34 UTC (permalink / raw)
To: David S . Miller, Jakub Kicinski, Paolo Abeni, Eric Dumazet
Cc: netdev, eric.dumazet, Eric Dumazet, Remi Denis-Courmont
Le torstaina 2. toukokuuta 2024, 19.17.00 EEST Eric Dumazet a écrit :
> fill_route() stores three components in the skb:
>
> - struct rtmsg
> - RTA_DST (u8)
> - RTA_OIF (u32)
>
> Therefore, rtm_phonet_notify() should use
>
> NLMSG_ALIGN(sizeof(struct rtmsg)) +
> nla_total_size(1) +
> nla_total_size(4)
>
> Fixes: f062f41d0657 ("Phonet: routing table Netlink interface")
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Remi Denis-Courmont <courmisch@gmail.com>
Acked-by: Rémi Denis-Courmont <courmisch@gmail.com>
--
Rémi Denis-Courmont
http://www.remlab.net/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net] phonet: fix rtm_phonet_notify() skb allocation
2024-05-02 16:17 [PATCH net] phonet: fix rtm_phonet_notify() skb allocation Eric Dumazet
2024-05-02 17:34 ` Rémi Denis-Courmont
@ 2024-05-07 2:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-05-07 2:00 UTC (permalink / raw)
To: Eric Dumazet; +Cc: davem, kuba, pabeni, netdev, eric.dumazet, courmisch
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Thu, 2 May 2024 16:17:00 +0000 you wrote:
> fill_route() stores three components in the skb:
>
> - struct rtmsg
> - RTA_DST (u8)
> - RTA_OIF (u32)
>
> Therefore, rtm_phonet_notify() should use
>
> [...]
Here is the summary with links:
- [net] phonet: fix rtm_phonet_notify() skb allocation
https://git.kernel.org/netdev/net/c/d8cac8568618
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:[~2024-05-07 2:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-02 16:17 [PATCH net] phonet: fix rtm_phonet_notify() skb allocation Eric Dumazet
2024-05-02 17:34 ` Rémi Denis-Courmont
2024-05-07 2:00 ` patchwork-bot+netdevbpf
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.