Skip to content

Commit d8cac85

Browse files
edumazetkuba-moo
authored andcommitted
phonet: fix rtm_phonet_notify() skb allocation
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: f062f41 ("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>
1 parent a26ff37 commit d8cac85

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

net/phonet/pn_netlink.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ void rtm_phonet_notify(int event, struct net_device *dev, u8 dst)
193193
struct sk_buff *skb;
194194
int err = -ENOBUFS;
195195

196-
skb = nlmsg_new(NLMSG_ALIGN(sizeof(struct ifaddrmsg)) +
196+
skb = nlmsg_new(NLMSG_ALIGN(sizeof(struct rtmsg)) +
197197
nla_total_size(1) + nla_total_size(4), GFP_KERNEL);
198198
if (skb == NULL)
199199
goto errout;

0 commit comments

Comments
 (0)