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 E152513D8B1; Tue, 14 May 2024 10:44:04 +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=1715683445; cv=none; b=Fq6iPYzUXsee0XuI8EFaYJ7G3mI9NFSPVLTDeerWwakSgcitRtXD89vWy26+ZvJM8pln7zFZBhvBKklM3SHZzrxPQWTHpaoWkXaJN+pfSCd2cpiquCw91Pen7B69sFQDgzX1Q+Yj6T8IH7SM5aOpCRX45tXj23OyedRy/Jz3GMw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715683445; c=relaxed/simple; bh=7x+Cry38gbkih7x0a84ewaYxnfsOYgMGc5VVYQ5W3+o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=U8lu7hTobJDFo//3dnmhKSqqrhBDohjUBYVqOWl9Cjm+8T+0Akbz/w10l+OAr+O2JIJqwvlvzsIMQobVlvvLNkRX9esiLQD4PMcFFiPKq/7KJAU37qIzukQVFTasbVqjdDbd2rcKA49tTtWYlg8Gg22F+Kqedl3gw2C8Y04QEyM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ETDwvid+; 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="ETDwvid+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4DE18C2BD10; Tue, 14 May 2024 10:44:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1715683444; bh=7x+Cry38gbkih7x0a84ewaYxnfsOYgMGc5VVYQ5W3+o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ETDwvid+uCtT54qP4bTsOeVpq9Z9W7obiEhjMWOJd3zp8BYNbCC1dzvtbGL8RgAGl Dg7aN/6DijVSfReY0D3T9aZozYFPjBHEDrVg2deVa5Z1R3EWB73WpXnNO5U/ZMEcQd UVUzzOMzovPwr9CkSI1Fm7qjjw3k563GxVYWyYVY= 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 6.8 210/336] phonet: fix rtm_phonet_notify() skb allocation Date: Tue, 14 May 2024 12:16:54 +0200 Message-ID: <20240514101046.541457651@linuxfoundation.org> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240514101038.595152603@linuxfoundation.org> References: <20240514101038.595152603@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 6.8-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