Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964955AbbGVMHI (ORCPT ); Wed, 22 Jul 2015 08:07:08 -0400 Received: from www62.your-server.de ([213.133.104.62]:54929 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934122AbbGVMHF (ORCPT ); Wed, 22 Jul 2015 08:07:05 -0400 Message-ID: <55AF8761.5020804@iogearbox.net> Date: Wed, 22 Jul 2015 14:06:57 +0200 From: Daniel Borkmann User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Konstantin Khlebnikov CC: netdev@vger.kernel.org, "David S. Miller" , Tejun Heo , cgroups@vger.kernel.org, Li Zefan , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] cgroup: net_cls: fix false-positive "suspicious RCU usage" References: <20150721164629.18385.14538.stgit@buzz> <20150722092320.30663.86742.stgit@buzz> <55AF84FC.2070502@iogearbox.net> <55AF869E.4030304@yandex-team.ru> In-Reply-To: <55AF869E.4030304@yandex-team.ru> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1557 Lines: 36 On 07/22/2015 02:03 PM, Konstantin Khlebnikov wrote: > On 22.07.2015 14:56, Daniel Borkmann wrote: >> On 07/22/2015 11:23 AM, Konstantin Khlebnikov wrote: >>> In dev_queue_xmit() net_cls protected with rcu-bh. >> ... >>> Signed-off-by: Konstantin Khlebnikov >>> --- >>> net/core/netclassid_cgroup.c | 3 ++- >>> 1 file changed, 2 insertions(+), 1 deletion(-) >>> >>> diff --git a/net/core/netclassid_cgroup.c b/net/core/netclassid_cgroup.c >>> index 1f2a126f4ffa..6441f47b1a8f 100644 >>> --- a/net/core/netclassid_cgroup.c >>> +++ b/net/core/netclassid_cgroup.c >>> @@ -23,7 +23,8 @@ static inline struct cgroup_cls_state >>> *css_cls_state(struct cgroup_subsys_state >>> >>> struct cgroup_cls_state *task_cls_state(struct task_struct *p) >>> { >>> - return css_cls_state(task_css(p, net_cls_cgrp_id)); >>> + return css_cls_state(task_css_check(p, net_cls_cgrp_id, >>> + rcu_read_lock_bh_held())); >> >> Did you also check that after your patch this doesn't trigger on ingress >> either? There, this code path could be invoked under rcu_read_lock(). So, >> perhaps you need to check for both. > > I haven't seen warnings with this patch. rcu_read_lock_held() is > checked inside rcu_dereference_check() inside task_css_check(). Thanks, agreed. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/