Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1614840pxb; Mon, 11 Oct 2021 09:31:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHSYqa/ZGLeiOD0XQhgC+TtQOqGSqz7zuSaSM5pDlUtoCfzTI4Tii+YOXNy6Ll9TQCL075 X-Received: by 2002:a62:8ccf:0:b0:44c:7db2:344e with SMTP id m198-20020a628ccf000000b0044c7db2344emr27087585pfd.66.1633969898093; Mon, 11 Oct 2021 09:31:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633969898; cv=none; d=google.com; s=arc-20160816; b=obX5pq0Tv0Htc5tGf6p6OJLRiDY+WTYXWiojNiCyjTWD5lu4ojsm+Gu/sAZ2iVE7wX W+mr0ZEExHErlF8AK2FXBnBwu3iI1TapruQdS+NERJYnKRr7MLzH4NkPZwWYQLmToWXG BM84YeIm4UJ9z/38S2C3yliCgjQp95ck2iuK8MWEgBmnXKQTceRXB+xjurge71eDOhsS DpuZmxhjjfWCTWs7M7gzEpFWDlSimGo46JA4ATsHUt/YZfkfy+jD+nT2jvSFNxVQ1Dh7 KXQvryEAxS8+L6k3hEvL+JQbNy142ajwuiw9LN1HMlogVWFgFJpMLHcKnaWK13NDumqU kZnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=eO+J6XT5S/soNk40IMfnCJiv7qamhEoJGrqx8FIjKi0=; b=v29QWRhIu5HwIxwZ5HL8yj+8y/7m6J4z9yOVLn9WVdhjMEYUapMJN+TCcSE4Xxq+tG SBI3Q6a+f5Jk95E7k/pw5SvWOU22aTk7MBBJYSIzlvW/vPhUdJSkCNqiRkws/cZEWcVn f8y3YKlCCThbUji/Pv3GQaZvIwlqn1OoTF+kxgSwtEYcD3ZLkIitKd6QQpdgZfiRafD7 HafC6AdFrKLwHP7xWHuO5A7WuSMesHnsqmMxgS3be1uVHfWAFfjJ+s5WH81AppE4aQnn lEQ8UzoyuF5sEszzSku4klL47EPG2ezfrssQEq9ew2qqUN2lw1IKBZuN2Tpa0Jk7/+D9 IxjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Tt1p1x4g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l18si15300472plh.436.2021.10.11.09.31.24; Mon, 11 Oct 2021 09:31:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Tt1p1x4g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237379AbhJKN5u (ORCPT + 99 others); Mon, 11 Oct 2021 09:57:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:43326 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238066AbhJKNzy (ORCPT ); Mon, 11 Oct 2021 09:55:54 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 25D7761108; Mon, 11 Oct 2021 13:53:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633960393; bh=Kyzx9gzkhlh9cQvf98cQU5z7YWyKKORuGEOaduWYYeA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Tt1p1x4gy+YQkzyNuGZdvouYp5tqoyW3zEkyK7c7+Nx9WEZKPiEY0xaIep8WE4ppU H1AKhhAiEHJ3KleDfZ7RhaYkZio1q28oA64+TrNNlJahlLA7gjZHC+/LjboEwYp3ON LvYFeK57hYKT9IV3ZqwzI8ezJoZ/MxTeCU37Ad7g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eric Dumazet , Vivien Didelot , Nikolay Aleksandrov , "David S. Miller" , Sasha Levin Subject: [PATCH 5.10 48/83] net: bridge: fix under estimation in br_get_linkxstats_size() Date: Mon, 11 Oct 2021 15:46:08 +0200 Message-Id: <20211011134510.050199985@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211011134508.362906295@linuxfoundation.org> References: <20211011134508.362906295@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Eric Dumazet [ Upstream commit 0854a0513321cf70bea5fa483ebcaa983cc7c62e ] Commit de1799667b00 ("net: bridge: add STP xstats") added an additional nla_reserve_64bit() in br_fill_linkxstats(), but forgot to update br_get_linkxstats_size() accordingly. This can trigger the following in rtnl_stats_get() WARN_ON(err == -EMSGSIZE); Fixes: de1799667b00 ("net: bridge: add STP xstats") Signed-off-by: Eric Dumazet Cc: Vivien Didelot Cc: Nikolay Aleksandrov Acked-by: Nikolay Aleksandrov Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/bridge/br_netlink.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c index bfe6ab1914c8..31b00ba5dcc8 100644 --- a/net/bridge/br_netlink.c +++ b/net/bridge/br_netlink.c @@ -1591,6 +1591,7 @@ static size_t br_get_linkxstats_size(const struct net_device *dev, int attr) return numvls * nla_total_size(sizeof(struct bridge_vlan_xstats)) + nla_total_size_64bit(sizeof(struct br_mcast_stats)) + + (p ? nla_total_size_64bit(sizeof(p->stp_xstats)) : 0) + nla_total_size(0); } -- 2.33.0