public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: David John <davidjon@xenontk.org>
Cc: jbarnes@virtuousgeek.org, andreas.herrmann3@amd.com, rjw@sisk.pl,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] Check the node argument passed to cpumask_of_node
Date: Mon, 4 Jan 2010 14:58:22 +1030	[thread overview]
Message-ID: <201001041458.24145.rusty@rustcorp.com.au> (raw)
In-Reply-To: <1262412947-3890-1-BlackWidow-davidjon@xenontk.org>

On Sat, 2 Jan 2010 04:45:47 pm David John wrote:
> Commit e0cd516 "PCI: derive nearby CPUs from device's instead of bus' NUMA information"
> causes an null pointer dereference when reading from the sysfs attributes local_cpu*
> on Intel machines with no ACPI NUMA proximity info, since dev->numa_node gets set to -1
> for all PCI devices, which then gets passed to cpumask_of_node.
> 
> Ensure that the node value is valid.

This only works for x86, and only for !CONFIG_DEBUG_PER_CPU_MAPS.

I suggest fixing the callers introduced in e0cd516 for the moment,
then if you feel enthused, change the semantics of cpumask_of_node and
remove the checks from the various callers.

(And please only check for -1: it has a special meaning, unlike other
invalid numbers which indicate a bug).

Thanks,
Rusty.

  reply	other threads:[~2010-01-04  4:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-01 19:50 [Regression] 2.6.33-rc2 - pci: Commit e0cd516 causes OOPS David John
2010-01-01 19:55 ` [PATCH] Check the node argument passed to cpumask_of_node David John
2010-01-01 21:55 ` [Regression] 2.6.33-rc2 - pci: Commit e0cd516 causes OOPS Rafael J. Wysocki
2010-01-02  6:15   ` [PATCH v2] Check the node argument passed to cpumask_of_node David John
2010-01-04  4:28     ` Rusty Russell [this message]
2010-01-04 11:42       ` David John
2010-01-04 14:58         ` [PATCH v3] " David John
2010-01-04 17:18           ` Jesse Barnes
2010-01-04  5:15     ` [PATCH v2] " Jin Dongming
2010-01-01 22:22 ` [Regression] 2.6.33-rc2 - pci: Commit e0cd516 causes OOPS Yinghai Lu
2010-01-02  6:18   ` David John

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=201001041458.24145.rusty@rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=andreas.herrmann3@amd.com \
    --cc=davidjon@xenontk.org \
    --cc=jbarnes@virtuousgeek.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@sisk.pl \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox