lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <202005161937.214F9A6@keescook>
Date:   Sat, 16 May 2020 19:38:04 -0700
From:   Kees Cook <keescook@...omium.org>
To:     Xiaoming Ni <nixiaoming@...wei.com>
Cc:     mcgrof@...nel.org, yzaikin@...gle.com, adobriyan@...il.com,
        mingo@...nel.org, peterz@...radead.org, akpm@...ux-foundation.org,
        yamada.masahiro@...ionext.com, bauerman@...ux.ibm.com,
        gregkh@...uxfoundation.org, skhan@...uxfoundation.org,
        dvyukov@...gle.com, svens@...ckframe.org, joel@...lfernandes.org,
        tglx@...utronix.de, Jisheng.Zhang@...aptics.com, pmladek@...e.com,
        bigeasy@...utronix.de, linux-kernel@...r.kernel.org,
        linux-fsdevel@...r.kernel.org, wangle6@...wei.com
Subject: Re: [PATCH 2/4] proc/sysctl: add shared variables -1

On Sat, May 16, 2020 at 11:05:53AM +0800, Xiaoming Ni wrote:
> On 2020/5/16 10:47, Kees Cook wrote:
> > On Sat, May 16, 2020 at 10:32:19AM +0800, Xiaoming Ni wrote:
> > > On 2020/5/16 0:05, Kees Cook wrote:
> > > > 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 <nixiaoming@...wei.com>
> > > > > > > ---
> > > > > > >     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.
> > > > 
> > > Later, when more features sysctl interface is moved to the code file, there
> > > will be more variables that need to be extracted.
> > > So should I only extract the neg_one variable here, or should I extract all
> > > the variables used by multiple features?
> > 
> > Hmm -- if you're going to do a consolidation pass, then nevermind, I
> > don't think order will matter then.
> > 
> > Thank you for the cleanup! Sorry we're giving you back-and-forth advice!
> > 
> > -Kees
> > 
> 
> Sorry, I don't fully understand.
> Does this mean that there is no need to adjust the patch order or the order
> of variables in sysctl_vals?
> Should I extract only SYSCTL_NEG_ONE or should I extract all variables?

I think either order is fine -- I though you were only doing 1 variable.
If you're don't a bunch, then I don't think order is important.

-- 
Kees Cook

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ