All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rik van Riel <riel@redhat.com>
To: Andrey Ryabinin <a.ryabinin@samsung.com>,
	peterz@infradead.org, mingo@redhat.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sched: core: fix out of bounds read in sched_init_numa()
Date: Fri, 07 Nov 2014 13:49:25 -0500	[thread overview]
Message-ID: <545D1435.90505@redhat.com> (raw)
In-Reply-To: <1415372020-1871-1-git-send-email-a.ryabinin@samsung.com>

-----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-----

  reply	other threads:[~2014-11-07 18:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-07 14:53 [PATCH] sched: core: fix out of bounds read in sched_init_numa() Andrey Ryabinin
2014-11-07 18:49 ` Rik van Riel [this message]
2014-11-10  9:36 ` [tip:sched/urgent] sched/numa: Fix " tip-bot for Andrey Ryabinin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=545D1435.90505@redhat.com \
    --to=riel@redhat.com \
    --cc=a.ryabinin@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.