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] [thread-next>] [day] [month] [year] [list]
Message-ID: <202203021030.EEEF58C2@keescook>
Date:   Wed, 2 Mar 2022 10:32:23 -0800
From:   Kees Cook <keescook@...omium.org>
To:     "Matthew Wilcox (Oracle)" <willy@...radead.org>
Cc:     Ingo Molnar <mingo@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Juri Lelli <juri.lelli@...hat.com>,
        Vincent Guittot <vincent.guittot@...aro.org>,
        Dietmar Eggemann <dietmar.eggemann@....com>,
        Steven Rostedt <rostedt@...dmis.org>,
        Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
        Daniel Bristot de Oliveira <bristot@...hat.com>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 00/19] Enable -Wshadow=local for kernel/sched

On Wed, Mar 02, 2022 at 04:34:32AM +0000, Matthew Wilcox (Oracle) wrote:
> I thought I'd choose one of the more core parts of the kernel to
> demonstrate the value of -Wshadow.  It found two places where there are
> shadowed variables that are at least confusing.  For all I know they're
> buggy and my resolution of these warnings is wrong.
> 
> The first 12 patches just untangle the unclean uses of __ret in wait.h
> & friends.  Then 4 patches to fix problems in headers that are noticed
> by kernel/sched.  Two patches fix the two places in kernel/sched/
> with shadowed variables and the final patch adds -Wshadow=local to
> the Makefile.

You are my hero. I was pulling my hair out trying to figure out how
to deal with this a few months ago, and the use of UNIQUE_ID was the
key. Yay!

> I'm quite certain this patch series isn't going in as-is.  But maybe
> it'll inspire some patches that can go in.

I think it's pretty darn close. One thing that can be done to test the
results for the first 12 patches is to do a binary comparison -- these
changes _should_ have no impact on the final machine code. (It'll
totally change the debug sections, etc, but the machine code should be
the same.)

-- 
Kees Cook

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ