Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2459435imd; Fri, 2 Nov 2018 11:46:31 -0700 (PDT) X-Google-Smtp-Source: AJdET5dMkz6DeB+3SDziBEOP1QcPW/IZfp5aWQHhKtAFDbOjzRTQy/NrXIcrbfcZtJUylVhR9Xvd X-Received: by 2002:a17:902:15c5:: with SMTP id a5-v6mr12665988plh.136.1541184391246; Fri, 02 Nov 2018 11:46:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541184391; cv=none; d=google.com; s=arc-20160816; b=AEu7Ep5P4/OS5hctFsO8rQjGx5+/6vIDoY2+50tDw2Bv1A8Cst89syRQDb7hjq7N9m kWoZX2f7znvbPryn5lNHoOmqyg7k4D/1M2AUsrR5gjGfsJ18cxLPYFBhzEo8eMTdAV/1 f+0KvLDRBrCrhbSOUhBfCEulMceIe49NMzUA6EF32DqdVLlfnmfx1hltJ/+p6w6E8sBH 01Hih9rw4xj5efefrA5Q3EuMgkiF17S/TzhhzE8utZueXfDp47OrBkk9zEA9SXyE6ktu L9MeFOtdcUE5qUdL23qvS4rTxi01SSsitrIw/BDjFV0Ev9rruTxm1Hm0esZ9jKiKVqYg ecYg== 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=FS0Dlj/avzgPu/mc3uDz49o3g6rnSYeJkaMkdTuVx/w=; b=m9BVMA52ZJibNjXCGeKcwgO9spQOWoJo2uy96PLJpRdHYpGIKLwafRQE3/LNv1RXYj oTqvJWf1Bp64bhd+LNYNRReC74kC6+DgF9HwfMDY/mYg0ndt0ATt48U8a2U+fnltdWHN XccC3heMHwCy769ZUBL6Hp3PEkhprmND7tQRzvl8g0bE89rzRFPFrhwIEUzbQyooeJXN l4a2gYYiCjqKdTeMI7WnH7c23enzfoFwkKbAXSTuyaLLS74Wh2NUagMlTmc559vuEHcR Av8pFQ8vwwjUO0UpeAaChJqFqRl9Ivxg4ujD+FUvgwswJZG69LMUby8vj8QZCNq83pYD h+Yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TtZp62XM; 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 m5-v6si8614713plt.432.2018.11.02.11.46.16; Fri, 02 Nov 2018 11:46:31 -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=TtZp62XM; 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 S1729983AbeKCDwH (ORCPT + 99 others); Fri, 2 Nov 2018 23:52:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:47382 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728565AbeKCDwH (ORCPT ); Fri, 2 Nov 2018 23:52:07 -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 E0F722084A; Fri, 2 Nov 2018 18:43:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541184234; bh=zUFGk27jOW0CwoZ6GjAtlmBQoDo9ETSySgBVWSFFk88=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TtZp62XMBM7wZNqLjyRp1T9dCeE1uGc1iLxlfM703TatuuxwUkf61M4mCzk0IJOfd bm3Kq43DqesTCTKK+e25HJ+JrxZaoXIiNtB0tjYyp3haUH12FIwO9dQ7scS+JjbX4T 6FHbxrH6zSS42kCFFBtqRTSs6agnyL9jVZpt54xA= 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.18 111/150] net: sched: gred: pass the right attribute to gred_change_table_def() Date: Fri, 2 Nov 2018 19:34:33 +0100 Message-Id: <20181102182910.924657343@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181102182902.250560510@linuxfoundation.org> References: <20181102182902.250560510@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.18-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 ||