Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp46876imu; Thu, 8 Nov 2018 14:31:09 -0800 (PST) X-Google-Smtp-Source: AJdET5ekGTNbkgnSvoEKJleDFUpuxuNbjmZC3f47+4qwoonYTSk3xXKckg+w9LXms1z1xXMQVp63 X-Received: by 2002:a17:902:64c1:: with SMTP id y1-v6mr6407243pli.210.1541716269676; Thu, 08 Nov 2018 14:31:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541716269; cv=none; d=google.com; s=arc-20160816; b=kVQBRfeJpWRVFTf82jzrbfmfint5eimp3DAJSD4YBbD7UT7xwkZC9FiJfaQKY1WAen ePnFPetoUmdJZ812wr8DnjAJANKx6A172Lak0P6jbObnlRbTqd8n5fch7ZZyatw0/84J I1NQjUZ3RYwZRmsq4AWqa5uO5PeAZN7RGMseE0xhp+WBVFpNP60PIZ+wMIFu0gMv+bIo wI0QbGTa1bi83AqgsoMytbHyGASn8uRSnyizjjh9KMU5yLmdvDKOYhVWwpuk25TdPpzI yooThZpVYpZptE8r17OTtHSXrN1DCCBrji4jJ2QOK+X6gHW5g8zaqymxwK4v1qhbXYGV AGGw== 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=bYeVVffwZd9iH1SCEF6DBRLc5MMMyKIx3ZSuNW/dXJg=; b=QUm/P1cBYkM3sNQaaTN8t52SZ8ZDJbLMRle4XKo9mpG2yMTOGuxEmeuwerL1pL4MCd AollP+2BfkS1EIKKLv+LN90z+1LmjpQMEAjXCYrtOd9puzn8lEE1MlyhnVWMvW0UqSlz NDDQxox//BbhyDEZUYl7PLYqTeOOCj/0wQNatfX7FHR3et7nRTHr8SncGZbYEJOr1KhZ SRNDsiS14ZyrMTLRXakSM9R5kmo2OvgVHUjNklYriqtrw3tX8VKw16w3fBGrhMJDX35f SnI01f2JA7rw0DJbs8gp5fjx+jiiLX+JoYzyyEvULAOqyg1qDZpZs9FBOmC+qMsw0Dv5 tR6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nUDq8N14; 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 t6-v6si5391044plq.275.2018.11.08.14.30.46; Thu, 08 Nov 2018 14:31:09 -0800 (PST) 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=nUDq8N14; 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 S1728090AbeKIIH7 (ORCPT + 99 others); Fri, 9 Nov 2018 03:07:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:57332 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729703AbeKIHiO (ORCPT ); Fri, 9 Nov 2018 02:38:14 -0500 Received: from localhost (unknown [208.72.13.198]) (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 42D0720989; Thu, 8 Nov 2018 22:00:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541714445; bh=TvUHD2TB0lc69ia0pqARE9d3gdweuUHmMcoHyrUloNY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nUDq8N14xttRRD94gN+C2ZvKGIz2l0/ce6MxLnx0AcRqVDNzcW1bS9jugd+3ejHOS JzrBKPtR0K7P0FpZk6pPNpVZyYAgxQ3fpvTdef9myeAcbTF9H5N/HJAhTw4uI6gCER xf0589crvR1DYN2GTLWRgiHavcwctMMAiUSs2u/g= 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.4 093/114] net: sched: gred: pass the right attribute to gred_change_table_def() Date: Thu, 8 Nov 2018 13:51:48 -0800 Message-Id: <20181108215109.183893142@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181108215059.051093652@linuxfoundation.org> References: <20181108215059.051093652@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.4-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 @@ -444,7 +444,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 ||