Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2458481yba; Mon, 15 Apr 2019 12:04:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqyi+MQSydeRtlb3n/9CT5IKuGpuDJ8wQ+zkzBgi+KyE2IX0jb6PbflEFKMGx9QKOFf51Ws0 X-Received: by 2002:a63:2a8f:: with SMTP id q137mr70303875pgq.31.1555355092666; Mon, 15 Apr 2019 12:04:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555355092; cv=none; d=google.com; s=arc-20160816; b=b9Uxm7Htgm8Ba0tGbIlG0pxD8xDlVYBai2JJ1urdggo/EWwqjQQ9VIXmTizwlz+xAn 4a8jNwBbja2CL0UvczXiCgJDyiBnIJJBTHBaLEH/tfUkl5vgJW8iaPwjXk5cJ3ptLUrz B0nr+PPb8oqwNpg6PvWi/ZQyy1wNQcL7Cu202YTZjNvtKSwpsZh4qSuNL3RLfI4+URwp hx5MUxVLjOr92ESSQ9ms3lGFkZVVspvY2QgWpENzL6NvuSh59yXPnTrjcw2B7xbfqlMt jMXf+mgCAZRC89azSBLkVWXFwBmf10eE0PWvjutYu64haRiz7Yxq7wkKkdqayCUz6Q/4 pEpQ== 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=F009e1UbF+SxDfOQPaQ/w+ZrngPXnQJF7cRMY6XEVkI=; b=RnnwE9RIe41syRnTG33v46ObcvqTt/Fy/q6XW3t00sonuH80v/YjIUdhLq2VuxrU1v 1EvPgqoeimlhqZWkRl35QVrFm5DZSZiiqLw9/VOKLyNFzJnoZvO08vKG0+a2vSGDrFcr 3vR+K1kNVPQEhZEdGh9WwvmCkJlmORSoyYLfyMFGvXoj3ygIOlrWrpmEtuqKhhNZ2vBq pr+HkL/2T+TtMs6F/yrqfG/AD40hdZU0hWoq+JrKCRGeisLipQiPeeVWzF5LuUUbPb2v CbW4Bi8z2r8D/oM/J/IzoctWGrhOFpchXIb7piME0i+lSLHeoHo/hxg33OHxToyeXmMX u5AQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xaYdVZpB; 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 c26si46458112pfd.155.2019.04.15.12.04.36; Mon, 15 Apr 2019 12:04:52 -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=xaYdVZpB; 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 S1728710AbfDOTCX (ORCPT + 99 others); Mon, 15 Apr 2019 15:02:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:33138 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728659AbfDOTCV (ORCPT ); Mon, 15 Apr 2019 15:02:21 -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 E00F02087C; Mon, 15 Apr 2019 19:02:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555354940; bh=/r+1RXDhGMvpkON4sP+q2RhQlyIUMdumIH8ArT0FEWI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xaYdVZpBDoPMGDA1Kl6PaSg259Ho6KKHc78H5IJ65+27IrcD/NT3lvxjG6Q1QsVjf aFcBQwmkfT+u8b3dgFW6daSlcIJ9aykeCsIWrEakZzaj+zZofNi6BKYG29NmZa/vc+ nimPqIQQTyWKjYYDTOdWk3GscRcOTYlpwr8w4yS4= 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" Subject: [PATCH 4.14 22/69] net/sched: fix ->get helper of the matchall cls Date: Mon, 15 Apr 2019 20:58:40 +0200 Message-Id: <20190415183730.445550198@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190415183726.036654568@linuxfoundation.org> References: <20190415183726.036654568@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: Nicolas Dichtel [ 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: Greg Kroah-Hartman --- net/sched/cls_matchall.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/net/sched/cls_matchall.c +++ b/net/sched/cls_matchall.c @@ -125,6 +125,11 @@ static void mall_destroy(struct tcf_prot 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; }