mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Vegard Nossum" <vegard.nossum@gmail.com>
To: "Adrian Bunk" <bunk@kernel.org>
Cc: "Rusty Russell" <rusty@rustcorp.com.au>,
	"Srivatsa Vaddagiri" <vatsa@in.ibm.com>,
	"Mike Travis" <travis@sgi.com>,
	linux-kernel@vger.kernel.org, "Gautham R Shenoy" <ego@in.ibm.com>,
	"Rafael J. Wysocki" <rjw@sisk.pl>,
	"Zhang, Yanmin" <yanmin.zhang@intel.com>,
	"Heiko Carstens" <heiko.carstens@de.ibm.com>
Subject: Re: v2.6.26-rc7: BUG: unable to handle kernel NULL pointer dereference
Date: Sun, 22 Jun 2008 18:29:07 +0200	[thread overview]
Message-ID: <19f34abd0806220929y1ca9d0c4nbf480473b7ce018a@mail.gmail.com> (raw)
In-Reply-To: <20080622155627.GA20122@cs181140183.pp.htv.fi>

On Sun, Jun 22, 2008 at 5:56 PM, Adrian Bunk <bunk@kernel.org> wrote:
>> commit e37d05dad7ff9744efd8ea95a70d389e9a65a6fc
>> Author: Mike Travis <travis@sgi.com>
>> Date:   Thu May 1 04:35:16 2008 -0700
>>
>>     cpu: change cpu_sys_devices from array to per_cpu variable
>>
>>     Change cpu_sys_devices from array to per_cpu variable in drivers/base/cpu.c.
>>...
>
> Can you confirm whether this is definitely the cause or not?
>
> E.g. if it is and 2.6.25 works fine it might qualify as a 2.6.26-rc
> regression.

Hm, no. Each time I run this test, I get a different error (has been
NULL pointer, stuck CPU, circular locking dependency, ...) :-D

But if you look at the patch, I KNOW that this function is the one
that returns NULL, and it does so because the check is now stricter
than before. The hunk was:

-       if (cpu < NR_CPUS)
-               return cpu_sys_devices[cpu];
+       if (cpu < nr_cpu_ids && cpu_possible(cpu))
+               return per_cpu(cpu_sys_devices, cpu);
        else
                return NULL;

And the (cpu < nr_cpu_ids) fails because the CPU has just been
offlined (or failed to initialize, but it's the same thing), while
NR_CPUS is the value that was compiled in as CONFIG_NR_CPUS (so the
former check will always be true).

I don't think it is valid to ask for a per_cpu() variable on a CPU
which does not exist, though, so I don't know what the right fix would
be. A straight revert would be possible, but probably not desirable.
I'm so definitely not an expert in this area, but this "fix" _looks_
correct to me:

diff --git a/drivers/base/topology.c b/drivers/base/topology.c
index fdf4044..3bd95fd 100644
--- a/drivers/base/topology.c
+++ b/drivers/base/topology.c
@@ -143,14 +143,10 @@ static int __cpuinit topology_cpu_callback(struct notifier
        int rc = 0;

        switch (action) {
-       case CPU_UP_PREPARE:
-       case CPU_UP_PREPARE_FROZEN:
+       case CPU_ONLINE:
                rc = topology_add_dev(cpu);
                break;
-       case CPU_UP_CANCELED:
-       case CPU_UP_CANCELED_FROZEN:
-       case CPU_DEAD:
-       case CPU_DEAD_FROZEN:
+       case CPU_DOWN_PREPARE:
                topology_remove_dev(cpu);
                break;
        }

I'm sorry, I can't really say whether it's a regression or not. But
I'd bet it is.


Vegard

-- 
"The animistic metaphor of the bug that maliciously sneaked in while
the programmer was not looking is intellectually dishonest as it
disguises that the error is the programmer's own creation."
	-- E. W. Dijkstra, EWD1036

  reply	other threads:[~2008-06-22 16:29 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-22 12:56 Vegard Nossum
2008-06-22 14:47 ` Vegard Nossum
2008-06-22 14:54   ` Vegard Nossum
2008-06-22 15:56     ` Adrian Bunk
2008-06-22 16:29       ` Vegard Nossum [this message]
2008-06-23  3:26         ` Rusty Russell
2008-06-23 16:58           ` Mike Travis
2008-06-24  1:36             ` Rusty Russell
2008-06-24  7:40               ` Vegard Nossum
2008-06-24  8:06               ` Zhang, Yanmin
2008-06-24  8:37                 ` Vegard Nossum
2008-06-24 13:14                 ` Rusty Russell
2008-06-24 14:44                   ` Mike Travis
2008-06-25  5:38                     ` Rusty Russell
2008-06-25 15:06                       ` Mike Travis
2008-06-26 12:58                   ` Gautham R Shenoy
2008-06-27  3:16                     ` Rusty Russell
2008-06-30 11:19                   ` Ingo Molnar
2008-06-26  0:59                 ` Zhang, Yanmin
2008-06-26  2:15                   ` Andrew Morton
2008-06-26  9:00                     ` Vegard Nossum
2008-06-26 12:40                       ` Jason Wessel
2008-06-26 13:59                         ` Vegard Nossum
2008-07-10 19:10                 ` Vegard Nossum

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=19f34abd0806220929y1ca9d0c4nbf480473b7ce018a@mail.gmail.com \
    --to=vegard.nossum@gmail.com \
    --cc=bunk@kernel.org \
    --cc=ego@in.ibm.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@sisk.pl \
    --cc=rusty@rustcorp.com.au \
    --cc=travis@sgi.com \
    --cc=vatsa@in.ibm.com \
    --cc=yanmin.zhang@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®