Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1625366imm; Wed, 16 May 2018 00:13:08 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoEHC6Q0ZVxPjfpEwisS+IWun3d4IkG7EuKMcwmfWkdZ8X8AuMMmtFLkiHXZN8hdFu/cjQj X-Received: by 2002:a65:52c8:: with SMTP id z8-v6mr10347134pgp.46.1526454787993; Wed, 16 May 2018 00:13:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526454787; cv=none; d=google.com; s=arc-20160816; b=HVVzniNMVfGU+p5o4iYgzACL52cO0YaF91ngsqhzqRKoz6BdK50pNSFfuZ1zTnelQw SGagIQAfHFPqsAlX30jLPMgYlm09xES8+nfsiJfogTJ+2ZRPvBN5DdZyrk+fAQBFJIM1 iw/nNzOgnvVvNBOKLJT3kQg5mspCjGLN2HR/iR6QcLC3uQNG6RpaoujyCPmVQh6rUl0H oRvEqRXVtiOMTpRrg6/W17T/8xUQcqJ7+tLxOWU3tL6Ai3mRF32Q4Fzs6JEwD55rYkZM K6Nr8ZZO+O/i8L9sQ5+5kBMmVpnYNtdvQtGthnJZy4cMHgvn9CINdDg3NrBrV7dMGxTD RiEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=aHcCuLIhz7xuy2CGi6UtpHboRZjpbA98fDqpHRt3r/g=; b=YgWvTmyLsvzhjRRel8+L02i8i0Muh8EkHm3mHM0sZln/buTACRO+QN/I6H21PSc0tp JRyeuoc+/ErZ+tR2m+m07ZPVq1qdwuexBxAYvUHDA507O/0tvJJ551rMVIqczwWJcbVX XrI6L4x3mhg1DI+ns83vk96HRM/ih3NvtdSy44Pyt0ssZHLL8hYZ64ihPPpXKsjjH+tu n791lYRv/uljTuWhi6Kai+/rJnjX4/xsEN/3r2rWw3aR+JTjmRonOCHMdGE+5k1jrEmQ kqqELWey8yl+dlN6nEwYWCFKrlRv6cL5ul+kIEspFRDZ3r+LdvMV59mKCt5hBBgBhNeM hECw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@resnulli-us.20150623.gappssmtp.com header.s=20150623 header.b=y9uXZDtX; 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 e12-v6si1631633pgn.155.2018.05.16.00.12.53; Wed, 16 May 2018 00:13:07 -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=@resnulli-us.20150623.gappssmtp.com header.s=20150623 header.b=y9uXZDtX; 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 S1752378AbeEPHMg (ORCPT + 99 others); Wed, 16 May 2018 03:12:36 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:38631 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751914AbeEPHMe (ORCPT ); Wed, 16 May 2018 03:12:34 -0400 Received: by mail-wr0-f195.google.com with SMTP id 94-v6so2586509wrf.5 for ; Wed, 16 May 2018 00:12:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=aHcCuLIhz7xuy2CGi6UtpHboRZjpbA98fDqpHRt3r/g=; b=y9uXZDtXaFt06ZGCAR8EYZAwUZYHyDyOZU5vMUJ7Q/bq65l3N4BYOpmkjxcs5ahqXZ yFNxd3O6fhFsomj/BRI2FHkx3QrixwBq8F/WqmqT2NQHVWxICzXjY01KF2CpeWpVoPMZ PHrN3QN6+GOM9+q+TNEjL6CJCjSyVvLGfECarT1o4gdXyz6tHFnNbxichXTJp449nRus A8jXOka6tBXSK8smvw7wD1FSwRpiYauJXPJ25X60+l0JeZuDqXBpykm1mkAsOyXB8ZYQ DfAEd+zZpcGl5Z5V40DvmGTYEVjwpgq5IcGM4smqpoMAVUdHkk0fHAQEPYmTH7Fp6uRE fixg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=aHcCuLIhz7xuy2CGi6UtpHboRZjpbA98fDqpHRt3r/g=; b=cLoHpmNydFkyHWoJPGKZ4nG6OSSrf9GzH8qVI7wF3zdTu1Jt0IhEXDbCECO/EFdsN5 Y5mQpYKj8jzyRG4xaG4p+zeeQZ3jPdvK7VYQDuYsShb1OCSBHiwuvt37BkKaJjNMDMTV 6E2RA4sh/wflRIeKCVAFsOYIMu9Iz5IHnogjIFzSzyf3BMWsN5CwpbU9nxpbVwL+7CdQ gj7wEQMEJ0WCcFZauGfd88Ohn/o/UklQpXYYwsnqGgTYEPNF0Xdfg1MtFeBxJOUqWtI7 B6FB9wa+OEAJAgcK/Ocb9tQhkX4Z9WgB0ujI88qhMCf57COvUH2QYNTc4uJ2z1rMxBYU kHwA== X-Gm-Message-State: ALKqPwclRlK8ctP9fDimDpa+HNyoCFKQNirpa6XkFeoqjIuDFeLN2KOD +qYbzcB1oYmh6qWHUKtjTSAsRg== X-Received: by 2002:adf:ad2d:: with SMTP id p42-v6mr13184566wrc.164.1526454753337; Wed, 16 May 2018 00:12:33 -0700 (PDT) Received: from localhost (ip-94-113-127-8.net.upcbroadband.cz. [94.113.127.8]) by smtp.gmail.com with ESMTPSA id m17-v6sm1604224wrh.3.2018.05.16.00.12.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 16 May 2018 00:12:32 -0700 (PDT) Date: Wed, 16 May 2018 09:12:32 +0200 From: Jiri Pirko To: Vlad Buslov Cc: netdev@vger.kernel.org, davem@davemloft.net, jhs@mojatatu.com, xiyou.wangcong@gmail.com, pablo@netfilter.org, kadlec@blackhole.kfki.hu, fw@strlen.de, ast@kernel.org, daniel@iogearbox.net, edumazet@google.com, keescook@chromium.org, linux-kernel@vger.kernel.org, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, kliteyn@mellanox.com Subject: Re: [PATCH 08/14] net: sched: account for temporary action reference Message-ID: <20180516071232.GA1972@nanopsycho> References: <1526308035-12484-1-git-send-email-vladbu@mellanox.com> <1526308035-12484-9-git-send-email-vladbu@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1526308035-12484-9-git-send-email-vladbu@mellanox.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Mon, May 14, 2018 at 04:27:09PM CEST, vladbu@mellanox.com wrote: >tca_get_fill function has 'bind' and 'ref' arguments that get passed >down to action dump function. These arguments values are subtracted from >actual reference and bind counter values before writing them to skb. > >In order to prevent concurrent action delete, RTM_GETACTION handler >acquires a reference to action before 'dumping' it and releases it >afterwards. This reference is temporal and should not be accounted by >userspace clients. (both logically and to preserver current API >behavior) > >Use existing infrastructure of tca_get_fill arguments to subtract that >temporary reference and not expose it to userspace. > >Signed-off-by: Vlad Buslov >--- > net/sched/act_api.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/net/sched/act_api.c b/net/sched/act_api.c >index 3f02cd1..2772276e 100644 >--- a/net/sched/act_api.c >+++ b/net/sched/act_api.c >@@ -935,7 +935,7 @@ tcf_get_notify(struct net *net, u32 portid, struct nlmsghdr *n, > if (!skb) > return -ENOBUFS; > if (tca_get_fill(skb, actions, portid, n->nlmsg_seq, 0, event, >- 0, 0) <= 0) { >+ 0, 1) <= 0) { > NL_SET_ERR_MSG(extack, "Failed to fill netlink attributes while adding TC action"); > kfree_skb(skb); > return -EINVAL; >@@ -1125,7 +1125,7 @@ tcf_del_notify(struct net *net, struct nlmsghdr *n, struct list_head *actions, > return -ENOBUFS; > > if (tca_get_fill(skb, actions, portid, n->nlmsg_seq, 0, RTM_DELACTION, >- 0, 1) <= 0) { >+ 0, 2) <= 0) { So now you are adjusting dump because of a change in a different patch right? This also breaks bisect.