From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CB45766B5E; Tue, 14 May 2024 11:50:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715687406; cv=none; b=Ek6b2f4EP8Nl07W9KKqV43iYPc1gs2iH/dr0x5bjFoBllPa7hi/4xe+RGv+fnVNSua+Bmj7KDU/3acpSJ62JgMv0sCzLorYzFlr3egep4kJlrue9fJiB2rqOTgQV0YDOfQyz498RnUI3X+NXTyMAQ59fZmNxbsZNvwwS61VkuHw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715687406; c=relaxed/simple; bh=OFYqIHXnZFPSfPkiupzXQTAyIYHJBkbIZajHE42CIJ0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=NxHxLOTi9ITJXTrIteLQ8bxN2zGjN8qew+BUtO+Ih9at/sGW0pFf2+RG86qninokyUblSIHYq7YrakvxEgmuiKCtOwfQrbYfgqLtjV/jWNl+2pjscdHB9ulVsv1BtPIr2LEmzD8jsgHgiAYaL54hrwm7ANt6RwvdB9cKcI2T874= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=XGGBIq75; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="XGGBIq75" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0D803C2BD10; Tue, 14 May 2024 11:50:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1715687406; bh=OFYqIHXnZFPSfPkiupzXQTAyIYHJBkbIZajHE42CIJ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XGGBIq75FUee4Bc3/ZszE0ntGvHrv6EvydXjSc/cRefyLPELsF8R1jq2Qe4BObhRo H/TSmkPal68iK0g7KD6f/01Ogwqg7YNKxKXs0atAGTWCVRl0NwqE/Ij/AB1wp0GS4y lhzEyZwymziPS7avaiiRRKnxGJgdDuk89ki5+9Io= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Eric Dumazet , =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.10 084/111] phonet: fix rtm_phonet_notify() skb allocation Date: Tue, 14 May 2024 12:20:22 +0200 Message-ID: <20240514101000.323977372@linuxfoundation.org> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240514100957.114746054@linuxfoundation.org> References: <20240514100957.114746054@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Eric Dumazet [ 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 Acked-by: Rémi Denis-Courmont Link: https://lore.kernel.org/r/20240502161700.1804476-1-edumazet@google.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- 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 59aebe2968907..dd4c7e9a634fb 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.43.0