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: <20181218124113.c5179c675dd217be7bed7d80@linux-foundation.org>
Date:   Tue, 18 Dec 2018 12:41:13 -0800
From:   Andrew Morton <akpm@...ux-foundation.org>
To:     Waiman Long <longman@...hat.com>
Cc:     Oscar Salvador <osalvador@...e.de>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] include/linux/nodemask.h: Use nr_node_ids instead of
 MAX_NUMNODES in nodemask_pr_args

On Tue, 18 Dec 2018 12:30:31 -0500 Waiman Long <longman@...hat.com> wrote:

> When viewing the /proc/<pid>/status file, one can see output lines like
> 
>   Cpus_allowed:	ffffffff,ffffffff,ffffffff
>   Cpus_allowed_list:	0-95
>   Mems_allowed:	00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,0000000f
>   Mems_allowed_list:	0-3

Oh dear.

> It looks really strange that so many bits are displayed in the
> "Mems_allowed:" line.  Whereas the "Cpus_allowed:" line is perfectly
> fine.
> 
> It is because the nodemask_pr_args() macro uses MAX_NUMNODES as the
> number of nodes to iterate. The cpumask_pr_args() macro uses nr_cpu_ids
> instead of MAX_CPUS. For nodes, there is a corresponding nr_node_ids.
> So it makes sense to use nr_node_ids instead to be consistent with
> "Cpus_allowed:".
> 
> With that change, the "Mems_allowed:" line becomes
> 
>   Mems_allowed:	f

OK, I guess.  There is a risk of breaking existing userspace, but any
half-decent parser should treat the above as equivalent.

However there are quite a lot of nodemask_pr_args() callers in the tree
and this patch potentially changes behaviour at all those sites. 
Please work through all those callers and show how the output is
altered so we can consider the patch's complete effect.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ