Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp615463ybk; Fri, 15 May 2020 09:07:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8MdSpeS5cvOSTa6b6YgmYbgjWNawVJ2gKGwXfWtO4Ezqhr3FmnOA9XmaUx/C0rEyVw7Go X-Received: by 2002:a17:906:70c2:: with SMTP id g2mr3598879ejk.207.1589558853397; Fri, 15 May 2020 09:07:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589558853; cv=none; d=google.com; s=arc-20160816; b=Qps3rXK2Nws0o+3jp4hL0yskOzo6/WUgRvxJeeBuREiu0meOxSBT0q+ptWCYsmhAkl UETuurd33y47Y0p+HclNw0++yFKBtSwJIUwhgkpoURyXCnpBvxnsgvSq6B6644wfpRjJ r1JVpKr864h7q63/Gs/GamB9gIZSSIO1AB7uEAjLClCApTozMJqVEJHftUrTh67+EQ4K vn63H78bbZtSBrIdSVoTcTIQKJWVzcrIJEiFfCMFh4jcYIwJKTyqN8rFarIu4TsQHkfG KagzOcwEpLifpjwkMGS1WHh/EXZM2GvHahVlyMf2kJabuxQypNqHVJsO1XkcYv0kXaEM 3wgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=kBN7u719Cy+shKvcAVCN3eO0onmk0cAZNndd2T91fYA=; b=08ovL2nBKa488ikCHZDwVy+v0iTT87FYn3YVFx70bvbRiXfpHBlC0p+NGrUrUBFSqV 53qxnIEyckvDG0d9NJvl+Su74BfmGrfgK3v8b9oRlBZ9RbjaXXTQE57w5V/ZyjpdXUfd gDfjkErB/GDM2U3F14es6dWeVjvGQLKY8ArNusrBZ/12yuyJqud+MtPAQ+lR/+2HR69t ndN/FBkp1MGqLZkVI+OvbFSXSAekf4OLvfaDrj9cpsoRWFuhyIC6gFVUj12zPiFaezLD egy69mW83oSNHMiC+j9Wna6KFWTvl/p5Z6vq+PGODT7i0UJypEiUPUHk7WUlpAsxKCkk jmug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=kWPQyQcI; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y18si1496469edi.492.2020.05.15.09.07.10; Fri, 15 May 2020 09:07:33 -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; dkim=pass header.i=@chromium.org header.s=google header.b=kWPQyQcI; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726532AbgEOQF0 (ORCPT + 99 others); Fri, 15 May 2020 12:05:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726239AbgEOQFZ (ORCPT ); Fri, 15 May 2020 12:05:25 -0400 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FEAFC061A0C for ; Fri, 15 May 2020 09:05:25 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id t11so1154812pgg.2 for ; Fri, 15 May 2020 09:05:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=kBN7u719Cy+shKvcAVCN3eO0onmk0cAZNndd2T91fYA=; b=kWPQyQcIp2zXKifRK1Dv6Ra/KBVZqU1Wut7JIevx+X1l3Fl1xt08KxLokd8gTA5nf/ phh2ydFNzpCGYimlY3sOGzsX+GLukMmnheQGuqhbdLLuIIC1/jK3wgszDfDBmtr4l5MS TPKA3kwehV8tvBgG0ClpGcazblx3HEXVVqnj4= 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; bh=kBN7u719Cy+shKvcAVCN3eO0onmk0cAZNndd2T91fYA=; b=srX7KEnPXR0FH/UmiK0yV2SFotwocXDGjcGkH59xrqqdm/ataB/H77k+Cm+WN8mBPB gj3VD7vy00Kg72V22vsFmn1j5wyHgcFvZYz7vbRG3pJfT2/TEW2ub0MM35W8tVU6VE3D +9FZ9gJM2wnXxY8WIRdsWg0hUbuZzeml/W5ObXDp3e/ZDqJtmj0O6PHPL1GI6FDGwQpS 37qw8mpNEUQdUITCeA6B9MSMkc0EakucrFAHiQaNdF9YM3JJ/0Azc9pP7lcBkpDlhp8S 4VQ/IHecijxfq+9zyVe9u6hYYzkd7eOxLOFNHLdTJkjNbtqA0dzYFN0akiGt0XHXPdc6 /fnA== X-Gm-Message-State: AOAM531wlvYfvWx4efc6bcaEpF+2pahvoNOlu7OEUswGkNlGtN/bcTGQ qG/fPp67R8UTZaXdxT5uOTmuL4GPVOM= X-Received: by 2002:a63:7152:: with SMTP id b18mr3761898pgn.100.1589558725255; Fri, 15 May 2020 09:05:25 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id k14sm2135911pgn.94.2020.05.15.09.05.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 09:05:24 -0700 (PDT) Date: Fri, 15 May 2020 09:05:23 -0700 From: Kees Cook To: Xiaoming Ni Cc: mcgrof@kernel.org, yzaikin@google.com, adobriyan@gmail.com, mingo@kernel.org, peterz@infradead.org, akpm@linux-foundation.org, yamada.masahiro@socionext.com, bauerman@linux.ibm.com, gregkh@linuxfoundation.org, skhan@linuxfoundation.org, dvyukov@google.com, svens@stackframe.org, joel@joelfernandes.org, tglx@linutronix.de, Jisheng.Zhang@synaptics.com, pmladek@suse.com, bigeasy@linutronix.de, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, wangle6@huawei.com Subject: Re: [PATCH 2/4] proc/sysctl: add shared variables -1 Message-ID: <202005150904.743BB3E52@keescook> References: <1589517224-123928-1-git-send-email-nixiaoming@huawei.com> <1589517224-123928-3-git-send-email-nixiaoming@huawei.com> <202005150105.33CAEEA6C5@keescook> <88f3078b-9419-b9c6-e789-7d6e50ca2cef@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <88f3078b-9419-b9c6-e789-7d6e50ca2cef@huawei.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 15, 2020 at 05:06:28PM +0800, Xiaoming Ni wrote: > On 2020/5/15 16:06, Kees Cook wrote: > > On Fri, May 15, 2020 at 12:33:42PM +0800, Xiaoming Ni wrote: > > > Add the shared variable SYSCTL_NEG_ONE to replace the variable neg_one > > > used in both sysctl_writes_strict and hung_task_warnings. > > > > > > Signed-off-by: Xiaoming Ni > > > --- > > > fs/proc/proc_sysctl.c | 2 +- > > > include/linux/sysctl.h | 1 + > > > kernel/hung_task_sysctl.c | 3 +-- > > > kernel/sysctl.c | 3 +-- > > > > How about doing this refactoring in advance of the extraction patch? > Before advance of the extraction patch, neg_one is only used in one file, > does it seem to have no value for refactoring? I guess it doesn't matter much, but I think it's easier to review in the sense that neg_one is first extracted and then later everything else is moved. -- Kees Cook