Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1932723ybb; Thu, 2 Apr 2020 09:57:52 -0700 (PDT) X-Google-Smtp-Source: APiQypJO2CjimG3HXMBz4tpmlJ66QUqD+U314Gll/z7VixoihXmh6EJnAnlsmqgZVcHdiHTukMSB X-Received: by 2002:a9d:70d0:: with SMTP id w16mr3351646otj.9.1585846672433; Thu, 02 Apr 2020 09:57:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585846672; cv=none; d=google.com; s=arc-20160816; b=tpYcx3sv1R9GWvHA5a9HLDuXLW4FceGl7kQpmO4w0b8Dw9IX2tPEMgWOjsO1/5/OoB nSs6v42S6Y7T0QSDeEL4cRUaSYEVQLQzHYnNil9NMdXuQyIYTSd49zmEOfDC/pubssQS MDa6HOvYvCEhSaoVk1r0ZhX/jh/SByu/5pyYa8xlUj9oIERiIHD1IVaV5vMrVGVBmmAK e9UdmpCXsIZpvfiixDwpkzOvULWgZCRtOOjglpEFETYq+25N7WIltDn/bAvyseLLnJ7w YbdcIsuMMExCtxJEF1WGoXOGg+tJNok/nrBShnW+wnD06rnsyu7R5WqLzaIUb7MG8iUD 7QKQ== 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=r75wMwNGptMAzk8X/bJWo9FUoo8EnDcMGX++kdUmEis=; b=RDcAW37zaUw/HUg4dY2OE3X74GfE/Bcz2KQJq22zSVBQ6hRfgmc779Ch//79rRvGig JsvO1e3ZRuSc7MP3iBHPTk1W0iSymXTu2b64FSxrJ06kfM9kuPANUwl/v/Q36SfpSPlO ItwPIj/ZqzsT9qN4vS0WrlucPIWqbfAwqxq9kvlZpKC3TDEGyptQD6jYkCrhF3XWZY8A 5nl+BCJ189frj5TkuKGMjBQ64tlN4fEwjUTUP7fl5gjHwa3/skLVIR8Ft6Qq/Sn8Otco 5GvExmy/uB69sUDgwnIvSueKw6vWg4O2VhDo37F/gPTyZRcUwCP3AYr88wWVMIJ3rqtU wRIg== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l14si2567454ooe.48.2020.04.02.09.57.39; Thu, 02 Apr 2020 09:57: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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389737AbgDBQGn (ORCPT + 99 others); Thu, 2 Apr 2020 12:06:43 -0400 Received: from mail-pj1-f66.google.com ([209.85.216.66]:40500 "EHLO mail-pj1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388972AbgDBQGm (ORCPT ); Thu, 2 Apr 2020 12:06:42 -0400 Received: by mail-pj1-f66.google.com with SMTP id kx8so1673020pjb.5; Thu, 02 Apr 2020 09:06:41 -0700 (PDT) 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=r75wMwNGptMAzk8X/bJWo9FUoo8EnDcMGX++kdUmEis=; b=YX4MPT62Mf/TmR53AjPvdSQKGOFKIgERLOg0ABQgFewgnlRpT1GFi2HPlqaj1cPN3P e8aVdu2txq19LPpBC7+fp95+rOS2vvK6NakWlnPOTeo/Hp6D7r+X2DTL/uhX5O33uJg1 HEC+3zD8wTkA4J0jJcNQ5Kw8GspgSjRUam8nkWZpBzhbX8nxaRcrx/vf+8PNXRGYxMYT q5/UIxp6JD+HWk91p6ZgFl+p+2604d129pR0OhDeERzRBqDPsuufORiZs+nn1UA7aQ6a Mi5ifs86YqKvoOenFsfrXg088AUZJ18855vKaufRolt5HEsRfUltXPxbsJoO0DlQdc8b NKBA== X-Gm-Message-State: AGi0PubyNUXVTLjVhAQy6qAYLIqIw8xe26tbfipP9jG3sUsFH1QdJg0W s0iXelZ2EEBRbhScoqD93ug= X-Received: by 2002:a17:90a:b282:: with SMTP id c2mr4676001pjr.6.1585843601072; Thu, 02 Apr 2020 09:06:41 -0700 (PDT) Received: from 42.do-not-panic.com (42.do-not-panic.com. [157.230.128.187]) by smtp.gmail.com with ESMTPSA id 185sm3983235pfz.119.2020.04.02.09.06.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Apr 2020 09:06:39 -0700 (PDT) Received: by 42.do-not-panic.com (Postfix, from userid 1000) id 90DAF40254; Thu, 2 Apr 2020 16:06:38 +0000 (UTC) Date: Thu, 2 Apr 2020 16:06:38 +0000 From: Luis Chamberlain To: Jules Irenge , Andrew Morton Cc: linux-kernel@vger.kernel.org, boqun.feng@gmail.com, Kees Cook , Iurii Zaikin , Alexey Dobriyan , "open list:PROC SYSCTL" Subject: Re: [PATCH 4/7] sysctl: Add missing annotation for start_unregistering() Message-ID: <20200402160638.GB11244@42.do-not-panic.com> References: <0/7> <20200331204643.11262-1-jbi.octave@gmail.com> <20200331204643.11262-5-jbi.octave@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200331204643.11262-5-jbi.octave@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 31, 2020 at 09:46:40PM +0100, Jules Irenge wrote: > Sparse reports a warning at start_unregistering() > > warning: context imbalance in start_unregistering() > - unexpected unlock > > The root cause is the missing annotation at start_unregistering() > Add the missing __must_hold(&sysctl_lock) annotation. > > Signed-off-by: Jules Irenge Acked-by: Luis Chamberlain Luis > --- > fs/proc/proc_sysctl.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c > index c75bb4632ed1..d1b5e2b35564 100644 > --- a/fs/proc/proc_sysctl.c > +++ b/fs/proc/proc_sysctl.c > @@ -307,6 +307,7 @@ static void proc_sys_prune_dcache(struct ctl_table_header *head) > > /* called under sysctl_lock, will reacquire if has to wait */ > static void start_unregistering(struct ctl_table_header *p) > + __must_hold(&sysctl_lock) > { > /* > * if p->used is 0, nobody will ever touch that entry again; > -- > 2.24.1 >