Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp4086265ybg; Sun, 7 Jun 2020 21:19:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8NvtKn0Ir7wX8nixdwzSy+zNkkiMZuP4bFi6v6p9fQxYYSVoQiLQrSHYy0e0GzlnyO1ML X-Received: by 2002:a17:906:a288:: with SMTP id i8mr19778585ejz.324.1591589996858; Sun, 07 Jun 2020 21:19:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591589996; cv=none; d=google.com; s=arc-20160816; b=ukIq0GC314M4phfvDqU9j/4bak980EHD/KEXOHp3Vv7dBfmOYXCKqmQEWM53ff2n/Q JrCtfoleuxaX6mKB7dGcXEEaRdPGvjf2BAZ3X464a9rlfi90cNcFT1hC+LLPm7EpxrSj Fk5MNbhLfME40ZabFMHWegbMPo+1poLa6+gBE9r8PI92+dMAYLOI4jQ3Zm5O2tXm66N6 2R27vILKT+gEtmqVkUXlfNozOllXvDssxK9VZ8wxFZUotF4oQAy7Ymw9ZTbzdBEb2bah gkgp/TZxfaF1S4ie/iNiz9YUTDe/E37Gzn/CBB88lxXue/2E6Wqz1u9/VKdxyk7h3tMn gHKQ== 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; bh=gxhUPTKwk43J22v/ERRa17cYvbEWV4a02xOXiu+IJYA=; b=KHOApMgzrhZ0KIQ6l6hOK4XXUFwwXiKeI0Cm6RRyle1PtCtu35ELauvnRYZGzIUDeS VFo+ZgzoTGcvYHbJc1qSkgj0CxwhpOPR87naK0Vc1DcZrWbBZt8nHXmlAMaSp5mPCQMv +2T8l5byRhAkgG+75ck7icuiTirnM1Jnwi4XGwAKzLGuFxQmX3IEBN+dn7e+eqJ2pbwt pkEpHOyM+LgMUW9SBFFEXifS+SQwFu6pO67SRvNrHWq8PTM3iMKHQucR3z6OdkOfY2QY KiygnTxGZOHNfr7tTumYrIBYdXvpw2jJY44XZ66bUiS0bLyK4BJoBtHeCd+5ZZFZQ7Kn 7yrA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p17si7971227ejy.722.2020.06.07.21.19.34; Sun, 07 Jun 2020 21:19:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727846AbgFHERi (ORCPT + 99 others); Mon, 8 Jun 2020 00:17:38 -0400 Received: from mail.hallyn.com ([178.63.66.53]:35396 "EHLO mail.hallyn.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725945AbgFHERg (ORCPT ); Mon, 8 Jun 2020 00:17:36 -0400 Received: by mail.hallyn.com (Postfix, from userid 1001) id 56612E4C; Sun, 7 Jun 2020 23:17:34 -0500 (CDT) Date: Sun, 7 Jun 2020 23:17:34 -0500 From: "Serge E. Hallyn" To: "Paul E. McKenney" Cc: Stephen Rothwell , Amol Grover , James Morris , "Serge E . Hallyn" , linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, Joel Fernandes , Madhuparna Bhowmik , linux-security-module@vger.kernel.org Subject: Re: [PATCH RESEND] device_cgroup: Fix RCU list debugging warning Message-ID: <20200608041734.GA10911@mail.hallyn.com> References: <20200406105950.GA2285@workstation-kernel-dev> <20200607062340.7be7e8d5@canb.auug.org.au> <20200607190840.GG4455@paulmck-ThinkPad-P72> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200607190840.GG4455@paulmck-ThinkPad-P72> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jun 07, 2020 at 12:08:40PM -0700, Paul E. McKenney wrote: > On Sun, Jun 07, 2020 at 06:23:40AM +1000, Stephen Rothwell wrote: > > Hi all, > > > > On Mon, 6 Apr 2020 16:29:50 +0530 Amol Grover wrote: > > > > > > exceptions may be traversed using list_for_each_entry_rcu() > > > outside of an RCU read side critical section BUT under the > > > protection of decgroup_mutex. Hence add the corresponding > > > lockdep expression to fix the following false-positive > > > warning: > > > > > > [ 2.304417] ============================= > > > [ 2.304418] WARNING: suspicious RCU usage > > > [ 2.304420] 5.5.4-stable #17 Tainted: G E > > > [ 2.304422] ----------------------------- > > > [ 2.304424] security/device_cgroup.c:355 RCU-list traversed in non-reader section!! > > > > > > Signed-off-by: Amol Grover > > > --- > > > security/device_cgroup.c | 3 ++- > > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > > > diff --git a/security/device_cgroup.c b/security/device_cgroup.c > > > index 7d0f8f7431ff..b7da9e0970d9 100644 > > > --- a/security/device_cgroup.c > > > +++ b/security/device_cgroup.c > > > @@ -352,7 +352,8 @@ static bool match_exception_partial(struct list_head *exceptions, short type, > > > { > > > struct dev_exception_item *ex; > > > > > > - list_for_each_entry_rcu(ex, exceptions, list) { > > > + list_for_each_entry_rcu(ex, exceptions, list, > > > + lockdep_is_held(&devcgroup_mutex)) { > > > if ((type & DEVCG_DEV_BLOCK) && !(ex->type & DEVCG_DEV_BLOCK)) > > > continue; > > > if ((type & DEVCG_DEV_CHAR) && !(ex->type & DEVCG_DEV_CHAR)) > > > -- > > > 2.24.1 > > > > > > > I have been carrying the above patch in linux-next for some time now. > > I have been carrying it because it fixes problems for syzbot (see the > > third warning in > > https://lore.kernel.org/linux-next/CACT4Y+YnjK+kq0pfb5fe-q1bqe2T1jq_mvKHf--Z80Z3wkyK1Q@mail.gmail.com/). > > Is there some reason it has not been applied to some tree? > > The RCU changes on which this patch depends have long since made it to > mainline, so it can go up any tree. I can take it if no one else will, > but it might be better going in via the security tree. > > Thanx, Paul James, do you mind pulling it in?