Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2452047imd; Fri, 2 Nov 2018 11:38:11 -0700 (PDT) X-Google-Smtp-Source: AJdET5ehkvGY0BJKz3yWl0ggj2Y8zXZNiLn6rkEvsQP4QMwdUdt2Y15TUk2uUBaMOJzCVhBjFrua X-Received: by 2002:a17:902:509:: with SMTP id 9-v6mr12554716plf.3.1541183891283; Fri, 02 Nov 2018 11:38:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541183891; cv=none; d=google.com; s=arc-20160816; b=tvovTGHUPIQnnbSMQrqbtUiJl6k+fcUvhzCot2jOZEcqS0IuqSO5bAjyDsE4H4YryQ yWobPRgYgVzkzHrn7GsacFg/C3XPUXAwDdMwi6lopSWCyKxRCnmUoR0PgQa8UTZLYbRh Wjj1xJan1DQau0FeD59xGTluNSUWfrJQNhZiPBeYof6KgQcCnWjc2PxyfHma7sp4g7Yo jsj0jcjcMkAYGDLVbhqWA5MSgw/+MdeBzOyWCn6fTABOm0ZxG+OdiB4rhxiLsLl3IHkz efQUc2k1NRvp9XsUFgxIqzvNZGJ6Vxes+oImrFlSpBQbAIAJY3WC9NMEYkoARkrqkqIN /o+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7Qi7BS+dX8wUQr6iiqARU6TJ5ydKdk4y9dO6xD33BPs=; b=Vzsx/ZR/G063VWgUdac8TVLjFe/uyvtlHtjbaT+WoZzNP7Ti7yak+YBQNmtxkHNcxU EMHyqxejiRcMW5HiGo4gL3pjRjujSV8DGJK6Ub7JkqB9JLua5VtNDNgt8L5M6VPAfWzq dG+dalZQpYwvgmIMLGwI1xeQWIy6SZ/Y6DPj9fEgeTmQWw3FPtCeYyDe9lvNtHD+EMrW IDJLZMB0vC8+Vac76g+BmRn8zO03wzvNuqzXv+IqMWdbVFR/z8nwTU6MqE7ep4NGiSrC Rjv6e2ZYX0QTRpaVqZhM7RzBjpbl2rNQ07k9dpZkLH1smJMzpB7Dg80zWlypGRFgad8t Do6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DmyivbeF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x5si111214pga.440.2018.11.02.11.37.56; Fri, 02 Nov 2018 11:38:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DmyivbeF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728516AbeKCDpS (ORCPT + 99 others); Fri, 2 Nov 2018 23:45:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:39062 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727556AbeKCDpR (ORCPT ); Fri, 2 Nov 2018 23:45:17 -0400 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0A5D72081B; Fri, 2 Nov 2018 18:37:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541183826; bh=2JMUBq+6H/W075kyRk+kpBuDmuI1+eimNugrvLUhf0s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DmyivbeFulQ1YtgUjzVdVO1o0FSbm6XwnYAvF1Bh3rNczFA+WJcrZTSDZqM/CtyVC LlrDVeTSZv8Pg9YQovjNWf66dFdQcytBrAgrrcrH0csWoWliWVtkDCjvl3Sd4YD/Dw YYvHmNdQTtCImVwt+oiB0/nsBLUtdewSpCPESLYk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jakub Kicinski , "David S. Miller" Subject: [PATCH 4.19 04/24] net: sched: gred: pass the right attribute to gred_change_table_def() Date: Fri, 2 Nov 2018 19:34:37 +0100 Message-Id: <20181102182840.441220856@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181102182839.725385066@linuxfoundation.org> References: <20181102182839.725385066@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jakub Kicinski [ Upstream commit 38b4f18d56372e1e21771ab7b0357b853330186c ] gred_change_table_def() takes a pointer to TCA_GRED_DPS attribute, and expects it will be able to interpret its contents as struct tc_gred_sopt. Pass the correct gred attribute, instead of TCA_OPTIONS. This bug meant the table definition could never be changed after Qdisc was initialized (unless whatever TCA_OPTIONS contained both passed netlink validation and was a valid struct tc_gred_sopt...). Old behaviour: $ ip link add type dummy $ tc qdisc replace dev dummy0 parent root handle 7: \ gred setup vqs 4 default 0 $ tc qdisc replace dev dummy0 parent root handle 7: \ gred setup vqs 4 default 0 RTNETLINK answers: Invalid argument Now: $ ip link add type dummy $ tc qdisc replace dev dummy0 parent root handle 7: \ gred setup vqs 4 default 0 $ tc qdisc replace dev dummy0 parent root handle 7: \ gred setup vqs 4 default 0 $ tc qdisc replace dev dummy0 parent root handle 7: \ gred setup vqs 4 default 0 Fixes: f62d6b936df5 ("[PKT_SCHED]: GRED: Use central VQ change procedure") Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/sched/sch_gred.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/sched/sch_gred.c +++ b/net/sched/sch_gred.c @@ -413,7 +413,7 @@ static int gred_change(struct Qdisc *sch if (tb[TCA_GRED_PARMS] == NULL && tb[TCA_GRED_STAB] == NULL) { if (tb[TCA_GRED_LIMIT] != NULL) sch->limit = nla_get_u32(tb[TCA_GRED_LIMIT]); - return gred_change_table_def(sch, opt); + return gred_change_table_def(sch, tb[TCA_GRED_DPS]); } if (tb[TCA_GRED_PARMS] == NULL ||