Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2476042yba; Mon, 15 Apr 2019 12:26:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqxd14YeFEgeL084vi6yCRbcS0PQdRYYD02YU4eplmkzCqu8Oyo6OENRttiA3WnuCupGoxsz X-Received: by 2002:a63:4241:: with SMTP id p62mr72188881pga.379.1555356377834; Mon, 15 Apr 2019 12:26:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555356377; cv=none; d=google.com; s=arc-20160816; b=tmfKKpeJv84Zy6IkkyZAuoKjd5wrxzjRC6aoeh/uidvYfVoTn4NNsdvFNA1t1bHbvf 8zQoKyLNGT5q+VXObw6el39i+vxna4sQcmNIllnj89/dCq4qqZl2nNYNo+4yWqNhxhHr 9H4cRAyFpw4ez0ebijGzWEnOY65PKN5UN7jFNcM+k9s2PGptRm3WM2UmaWpilW7oFtNi NEBnUGoGKL7TggYz3krkcmGtI89nLi+q+giRWX/VSl+1HnqJkwE0wBodgZ4TcDCgac62 Ox43+fIhYQPcOQoYD9K5cf4sg4hzuiRz3He1xon4kTqYNNrvTdES+I2rIg7IluibEiD1 9LTw== 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=dxbIwR+ViH0Z9P8Zji1rIRmZYu1tAgOETXXogd8A2ic=; b=swzozlpZCobcCalXeQ22OeD6AmmX+H4BdU8XdH/QtOkcdYbUIWr18LCGEK4tbSOD4d 5BEyfjJzqLMXyzzf/dYRMVdn3fvxvhbPxXLpmleCPwlAeAnwDqMuZ2ovsynswLVTVVNj YZgqUOugvo4NUX9SENI04TrZi+PVp3lllXd26SnAbkTLG8seoM/mVcugS1ca00trJuuh H1tOA5LfhLVq5nOQSRvadPnKqDzw697QFebE6/tSIBUw1QNM0vFnBHPnrWXuA345Ehj8 51+6mgWn71XnOBz2E3/WJJK9BaD5HhbGWRdJ7EiUcdhzwJGodllqKdyu3ViysJKxm0PR WTQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ka4R9mG+; 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 x131si45996448pgx.73.2019.04.15.12.26.01; Mon, 15 Apr 2019 12:26:17 -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=ka4R9mG+; 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 S1730450AbfDOTYw (ORCPT + 99 others); Mon, 15 Apr 2019 15:24:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:39954 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729799AbfDOTFy (ORCPT ); Mon, 15 Apr 2019 15:05:54 -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 8F30420880; Mon, 15 Apr 2019 19:05:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555355154; bh=WM1D6163QxRw5VzrkPCs15QUzrZCbRZ+YLhUvauaQp0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ka4R9mG+C5EjO0mLweCGMvkh27le/VOMTm+ts2rE1ElNrZkLQ6eNHqA/UbjF8ECAA A+179e2cbE6q3b5O7Dw44Qlw6gcHj9CxIdok7IlyjEvJo/Wh5dHWZ0Z80on9YZhAyC BdUxFuMTHK/uqvChOIQwuj+8V+p6BXRSgO/to/Ig= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yotam Gigi , Jiri Pirko , Nicolas Dichtel , "David S. Miller" , Sasha Levin Subject: [PATCH 4.19 016/101] net/sched: fix ->get helper of the matchall cls Date: Mon, 15 Apr 2019 20:58:14 +0200 Message-Id: <20190415183741.232398988@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190415183740.341577907@linuxfoundation.org> References: <20190415183740.341577907@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 [ Upstream commit 0db6f8befc32c68bb13d7ffbb2e563c79e913e13 ] It returned always NULL, thus it was never possible to get the filter. Example: $ ip link add foo type dummy $ ip link add bar type dummy $ tc qdisc add dev foo clsact $ tc filter add dev foo protocol all pref 1 ingress handle 1234 \ matchall action mirred ingress mirror dev bar Before the patch: $ tc filter get dev foo protocol all pref 1 ingress handle 1234 matchall Error: Specified filter handle not found. We have an error talking to the kernel After: $ tc filter get dev foo protocol all pref 1 ingress handle 1234 matchall filter ingress protocol all pref 1 matchall chain 0 handle 0x4d2 not_in_hw action order 1: mirred (Ingress Mirror to device bar) pipe index 1 ref 1 bind 1 CC: Yotam Gigi CC: Jiri Pirko Fixes: fd62d9f5c575 ("net/sched: matchall: Fix configuration race") Signed-off-by: Nicolas Dichtel Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/sched/cls_matchall.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/net/sched/cls_matchall.c b/net/sched/cls_matchall.c index 856fa79d4ffd..621bc1d5b057 100644 --- a/net/sched/cls_matchall.c +++ b/net/sched/cls_matchall.c @@ -126,6 +126,11 @@ static void mall_destroy(struct tcf_proto *tp, struct netlink_ext_ack *extack) static void *mall_get(struct tcf_proto *tp, u32 handle) { + struct cls_mall_head *head = rtnl_dereference(tp->root); + + if (head && head->handle == handle) + return head; + return NULL; } -- 2.19.1