Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp5852648ybn; Sun, 29 Sep 2019 07:06:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqxiMWxYZqummARPAWvG987d+fk6apC0pz7cXkvjf9HM6ZU3Zzvh9QrA+G9ZlAwnEuzMt8LM X-Received: by 2002:a50:935d:: with SMTP id n29mr14755375eda.294.1569765966429; Sun, 29 Sep 2019 07:06:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569765966; cv=none; d=google.com; s=arc-20160816; b=ZiPUCmxIOci2tVzz8hrfE/7ZYGshcUukLP7075xTXpoJnYnl/5jhpSZJts7OVDQ/AV UNLq8fmcjNZeDIxCjG6WKtvNFcFPKojHDE3wAM4h645llz71VysvkCVZanDjgGj3rbMf 1MbJaFsumPci2QtZ+xo69GUReszPirmHRr6eaverM127b4CoA3Ex/47AWGVt9ZrE86lK EFQ0bgxdr//POWMEnPUgj+zjbzP8yYtq6RnkIUk+l7FNVJiWCj1yId9ASItIRgDkGxc4 C3PDixMsb8JM8IOMOgIvYTs66WelWosb+0FqMfWH5eaecGD8U4KoD7SrGKDHUoTXD5Kt y4zw== 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=u/3xyfn/aMcbjN07gaHCvK1wX4nyV2nher/23Z+PXrU=; b=UeYPJgyVn4AWx6krDNZ6VdkMhz7kg1uwhr5CStsTkNjuw4VR74zBKISferrBA4xYlm xPt9Vuca3k8lGyx1ssuXX9Q1jgKGwpCzhUkgaoLPfnksVV3rQNCnPAFydPhfO9jsmrfs HcJTGpUof//6HoIbYD69T2teVlc9y67f/oT2AnEW9eqB0aMmHr8ewsuYvNoPwtAHTHtu Vd3jQp8VOjWJzHXlUsLlKt2uXoar0FG0klasMOXRgw7VeLde9YViLzODfm0pLDec8c8k yM1dbXGKioGUoIc8CVjXW5w4k+fOWbwRDjebLP6Fmp3Ygs+aOOx/6aMuUdXlngaT0idQ gmWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jPcGluhm; 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 27si5201551edz.186.2019.09.29.07.05.41; Sun, 29 Sep 2019 07:06:06 -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=jPcGluhm; 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 S1729014AbfI2OCR (ORCPT + 99 others); Sun, 29 Sep 2019 10:02:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:44818 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730172AbfI2OCQ (ORCPT ); Sun, 29 Sep 2019 10:02:16 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 73C1A2082F; Sun, 29 Sep 2019 14:02:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1569765735; bh=h7aXqYbuaeCQa/Wtp9rWH6rdp8pPeonuM38BRTgkl0M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jPcGluhmxr1nldyCNHKX/CsAd5r4pd1dQycW+9W6IxprEpeQ+Po/GMouinWYj4+Cv vdvGYX/v2xHQMcjtfyuNe9R/jl9Bct7x0d1MqrssLgs1WBsRiNLqaRMMx/hEcUpmao FWD17cdmrQnZIubalRjsiKkSto0CP0mkeG4a5rTc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+21b29db13c065852f64b@syzkaller.appspotmail.com, Jamal Hadi Salim , Jiri Pirko , Cong Wang , "David S. Miller" , Sasha Levin Subject: [PATCH 5.2 44/45] net_sched: check cops->tcf_block in tc_bind_tclass() Date: Sun, 29 Sep 2019 15:56:12 +0200 Message-Id: <20190929135034.757719891@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190929135024.387033930@linuxfoundation.org> References: <20190929135024.387033930@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Cong Wang [ Upstream commit 8b142a00edcf8422ca48b8de88d286efb500cb53 ] At least sch_red and sch_tbf don't implement ->tcf_block() while still have a non-zero tc "class". Instead of adding nop implementations to each of such qdisc's, we can just relax the check of cops->tcf_block() in tc_bind_tclass(). They don't support TC filter anyway. Reported-by: syzbot+21b29db13c065852f64b@syzkaller.appspotmail.com Cc: Jamal Hadi Salim Cc: Jiri Pirko Signed-off-by: Cong Wang Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/sched/sch_api.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index 04faee7ccbce6..1047825d9f48d 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c @@ -1920,6 +1920,8 @@ static void tc_bind_tclass(struct Qdisc *q, u32 portid, u32 clid, cl = cops->find(q, portid); if (!cl) return; + if (!cops->tcf_block) + return; block = cops->tcf_block(q, cl, NULL); if (!block) return; -- 2.20.1