phonet: fix rtm_phonet_notify() skb allocation
authorEric Dumazet <edumazet@google.com>
Thu, 2 May 2024 16:17:00 +0000 (16:17 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 May 2024 09:50:58 +0000 (11:50 +0200)
commit4ff334cade9dae50e4be387f71e94fae634aa9b4
tree0b8f9fa9ab56f8b194a6c9a03d4ef920051c0843
parentbb739796564a022c4ea8353bee7a6a400df6d44c
phonet: fix rtm_phonet_notify() skb allocation

[ Upstream commit d8cac8568618dcb8a51af3db1103e8d4cc4aeea7 ]

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>
Acked-by: Rémi Denis-Courmont <courmisch@gmail.com>
Link: https://lore.kernel.org/r/20240502161700.1804476-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/phonet/pn_netlink.c