Messages in this thread | | | Date | Fri, 07 Nov 2014 13:49:25 -0500 | From | Rik van Riel <> | Subject | Re: [PATCH] sched: core: fix out of bounds read in sched_init_numa() |
| |
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 11/07/2014 09:53 AM, Andrey Ryabinin wrote:
> Zero 'level' (e.g. on non-NUMA system) causing out of bounds > access in this line: > > sched_max_numa_distance = sched_domains_numa_distance[level - 1]; > > Fix this by exiting from sched_init_numa() earlier. > > Signed-off-by: Andrey Ryabinin <a.ryabinin@samsung.com> Fixes: > 9942f79ba ("sched/numa: Export info needed for NUMA balancing on > complex topologies")
Reviewed-by: Rik van Riel <riel@redhat.com>
> Another option would be to not call sched_init_numa() if > nr_node_ids == 1, but I'm not sure that there is no such > configuration where nr_node_ids > 1 and node_distance(i, j) = > node_distance(0, 0) for any i and j.
When there is only one node, the distance from the node to itself will always be equal to node_distance(0, 0)
I am somewhat surprised we go through all of sched_init_numa on a non-numa system, though :)
- -- All rights reversed -----BEGIN PGP SIGNATURE----- Version: GnuPG v1
iQEcBAEBAgAGBQJUXRQ1AAoJEM553pKExN6D+h4H/jWfrFnEJFJMIrZU/nK5EcHg CiUGVJH2f4jL6qCSRIIduxyyu9qggsQ5Qp7Ci5bfGm98Sj89DNnXUv4sarPWT3zA KIDM+BuKFjKSXfCjcwrCkBP6x8gIYgCLR3hSThmq/MPrbNULy+1SUslb77i3kmBK OhLrjSC0SQty5yvGkCfWYGGh7rRboRcfVyckvODRRdhwHtBP1p/seDNWHadAeX+d WRNqdqJkvwwJ+eW9e7e009+OqB2EmS9xKBjXGIc7zEehfgOaeROQZ8sL7exs2g3n 6gtnWpn4firR15BSaHdK8kaEmsReWUZdrIebNVsUDmErN97O/AJ9UygJ5wUenzQ= =YPeU -----END PGP SIGNATURE-----
| |