All of lore.kernel.org
 help / color / mirror / Atom feed
From: pageexec@freemail.hu
To: Andrew Morton <akpm@linux-foundation.org>,
	Andi Kleen <ak@suse.de>,
	travis@sgi.com
Cc: Christoph Lameter <clameter@sgi.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] mm: Prevent dereferencing non-allocated per_cpu variables
Date: Wed, 28 Nov 2007 00:01:57 +0200	[thread overview]
Message-ID: <474CAFF5.8792.356C2F62@pageexec.freemail.hu> (raw)
In-Reply-To: <20071127215054.660250000@sgi.com>

On 27 Nov 2007 at 13:50, travis@sgi.com wrote:

> Change loops controlled by 'for (i = 0; i < NR_CPUS; i++)' to use
> 'for_each_possible_cpu(i)' when there's a _remote possibility_ of
> dereferencing a non-allocated per_cpu variable involved.

actually, it's not that remote, it happens every time
NR_CPUS > num_possible_cpus(). i ran into this myself
on a dual core box with NR_CPUS=4. due to my rewrite
of the i386 per-cpu segment handling, i actually got
a NULL deref where the vanilla kernel would be accessing
the area of [__per_cpu_start, __per_cpu_end] for each
non-possible CPU (which doesn't crash per se but is
still not correct somehow i think).


WARNING: multiple messages have this Message-ID (diff)
From: pageexec@freemail.hu
To: Andrew Morton <akpm@linux-foundation.org>,
	Andi Kleen <ak@suse.de>,
	travis@sgi.com
Cc: Christoph Lameter <clameter@sgi.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] mm: Prevent dereferencing non-allocated per_cpu variables
Date: Wed, 28 Nov 2007 00:01:57 +0200	[thread overview]
Message-ID: <474CAFF5.8792.356C2F62@pageexec.freemail.hu> (raw)
In-Reply-To: <20071127215054.660250000@sgi.com>

On 27 Nov 2007 at 13:50, travis@sgi.com wrote:

> Change loops controlled by 'for (i = 0; i < NR_CPUS; i++)' to use
> 'for_each_possible_cpu(i)' when there's a _remote possibility_ of
> dereferencing a non-allocated per_cpu variable involved.

actually, it's not that remote, it happens every time
NR_CPUS > num_possible_cpus(). i ran into this myself
on a dual core box with NR_CPUS=4. due to my rewrite
of the i386 per-cpu segment handling, i actually got
a NULL deref where the vanilla kernel would be accessing
the area of [__per_cpu_start, __per_cpu_end] for each
non-possible CPU (which doesn't crash per se but is
still not correct somehow i think).

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2007-11-27 23:02 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20071127215052.090968000@sgi.com>
2007-11-27 21:50 ` [PATCH 1/1] mm: Prevent dereferencing non-allocated per_cpu variables travis
2007-11-27 21:50   ` travis
2007-11-27 22:01   ` pageexec [this message]
2007-11-27 22:01     ` pageexec
2007-11-27 22:16   ` Andi Kleen
2007-11-27 22:16     ` Andi Kleen
2007-11-27 23:12     ` Andrew Morton
2007-11-27 23:12       ` Andrew Morton
2007-11-27 23:15       ` Christoph Lameter
2007-11-27 23:15         ` Christoph Lameter
2007-11-27 23:21       ` Andrew Morton
2007-11-27 23:21         ` Andrew Morton
2007-11-27 23:22         ` Christoph Lameter
2007-11-27 23:22           ` Christoph Lameter
2007-11-27 23:42           ` Andrew Morton
2007-11-27 23:42             ` Andrew Morton
2007-11-27 23:48             ` Andi Kleen
2007-11-27 23:48               ` Andi Kleen
2007-11-28  0:15               ` Christoph Lameter
2007-11-28  0:15                 ` Christoph Lameter
2007-11-28  0:09             ` Christoph Lameter
2007-11-28  0:09               ` Christoph Lameter

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=474CAFF5.8792.356C2F62@pageexec.freemail.hu \
    --to=pageexec@freemail.hu \
    --cc=ak@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=clameter@sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=travis@sgi.com \
    /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.