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: <20190902181731.GB35858@gmail.com>
Date:   Mon, 2 Sep 2019 20:17:31 +0200
From:   Ingo Molnar <mingo@...nel.org>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     Yunsheng Lin <linyunsheng@...wei.com>, dalias@...c.org,
        linux-sh@...r.kernel.org, catalin.marinas@....com,
        dave.hansen@...ux.intel.com, heiko.carstens@...ibm.com,
        linuxarm@...wei.com, jiaxun.yang@...goat.com,
        linux-mips@...r.kernel.org, mwb@...ux.vnet.ibm.com,
        paulus@...ba.org, hpa@...or.com, sparclinux@...r.kernel.org,
        chenhc@...ote.com, will@...nel.org, cai@....pw,
        linux-s390@...r.kernel.org, ysato@...rs.sourceforge.jp,
        mpe@...erman.id.au, x86@...nel.org, rppt@...ux.ibm.com,
        borntraeger@...ibm.com, dledford@...hat.com, mingo@...hat.com,
        jeffrey.t.kirsher@...el.com, benh@...nel.crashing.org,
        jhogan@...nel.org, nfont@...ux.vnet.ibm.com, mattst88@...il.com,
        len.brown@...el.com, gor@...ux.ibm.com, anshuman.khandual@....com,
        bp@...en8.de, luto@...nel.org, tglx@...utronix.de,
        naveen.n.rao@...ux.vnet.ibm.com,
        linux-arm-kernel@...ts.infradead.org, rth@...ddle.net,
        axboe@...nel.dk, linuxppc-dev@...ts.ozlabs.org,
        linux-kernel@...r.kernel.org, ralf@...ux-mips.org,
        tbogendoerfer@...e.de, paul.burton@...s.com,
        linux-alpha@...r.kernel.org, ink@...assic.park.msu.ru,
        akpm@...ux-foundation.org, robin.murphy@....com,
        davem@...emloft.net
Subject: Re: [PATCH v2 2/9] x86: numa: check the node id consistently for x86


* Peter Zijlstra <peterz@...radead.org> wrote:

> Also note that the CONFIG_DEBUG_PER_CPU_MAPS version of
> cpumask_of_node() already does this (although it wants the below fix).
> 
> ---
> diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c
> index e6dad600614c..5f49c10201c7 100644
> --- a/arch/x86/mm/numa.c
> +++ b/arch/x86/mm/numa.c
> @@ -861,7 +861,7 @@ void numa_remove_cpu(int cpu)
>   */
>  const struct cpumask *cpumask_of_node(int node)
>  {
> -	if (node >= nr_node_ids) {
> +	if ((unsigned)node >= nr_node_ids) {
>  		printk(KERN_WARNING
>  			"cpumask_of_node(%d): node > nr_node_ids(%u)\n",
>  			node, nr_node_ids);

Nitpicking: please also fix the kernel message to say ">=".

With that:

Acked-by: Ingo Molnar <mingo@...nel.org>

Note that:

- arch/arm64/mm/numa.c copied the same sign bug (or unrobustness if we 
  don't want to call it a bug).

- Kudos to the mm/memcontrol.c and kernel/bpf/syscall.c teams for not 
  copying that bug. Booo for none of them fixing the buggy pattern 
  elsewhere in the kernel ;-)

Thanks,

	Ingo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ