From: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
To: linux-pci@vger.kernel.org, "Barnes, Jesse" <jesse.barnes@intel.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>,
Len Brown <lenb@kernel.org>,
linux-acpi@vger.kernel.org,
linux-kernel <linux-kernel@vger.kernel.org>,
shaohua.li@intel.com, Grant Grundler <grundler@parisc-linux.org>
Subject: [PATCH 1/8] PCI/ACPI: fix wrong assumption in acpi_pci_get_bridge_handle
Date: Wed, 28 Jan 2009 20:48:58 +0900 [thread overview]
Message-ID: <4980462A.7080507@jp.fujitsu.com> (raw)
In-Reply-To: <498045D1.60005@jp.fujitsu.com>
Current acpi_pci_get_bridge_handle() has an assumption that
pci_bus->self is NULL on the root pci bus. But it might not true on
some platforms. Because of this wrong assumption, current
acpi_pci_get_bridge_handle() might return improper ACPI handle. We
must check pci_bus->parent instead.
This bug is the root cause of the following kernel panic reported by
James Bottomley. This problem was introduced by the commit
e8c331e963c58b83db24b7d0e39e8c07f687dbc6. The immediate cause was
acpi_pci_get_bridge_handle() returned NULL unexpectedly and it was
passed as the second argument of acpi_walk_namespace().
pci_hotplug: PCI Hot Plug PCI Core version: 0.5
acpiphp: ACPI Hot Plug PCI Controller Driver version: 0.5
BUG: unable to handle kernel NULL pointer dereference at 0000000000000010
IP: [<ffffffff8039646f>] acpi_ns_get_next_node+0xb/0x3c
PGD 0
Oops: 0000 [#1] SMP
last sysfs file:
CPU 0
Modules linked in:
Pid: 1, comm: swapper Not tainted 2.6.28 #1
RIP: 0010:[<ffffffff8039646f>] [<ffffffff8039646f>] acpi_ns_get_next_node+0xb/0x3c
RSP: 0018:ffff88007f87fd30 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000000 R08: ffffffff8037d260 R09: ffff88007f87fdfc
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000001
R13: 0000000000000000 R14: 0000000000000001 R15: 0000000000000000
FS: 0000000000000000(0000) GS:ffffffff80742040(0000) knlGS:0000000000000000
CS: 0010 DS: 0018 ES: 0018 CR0: 000000008005003b
CR2: 0000000000000010 CR3: 0000000000201000 CR4: 00000000000006a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process swapper (pid: 1, threadinfo ffff88007f87e000, task ffff88007f875040)
Stack:
0000000000000000 ffffffff803964f5 ffff88007f81b728 0000000000001001
ffff88007f87fdfc ffffffff8037d260 0000000600000001 0000000000000000
ffffffff8037d260 0000000000000000 0000000000000001 ffff88007f87fdfc
Call Trace:
[<ffffffff803964f5>] acpi_ns_walk_namespace+0x55/0x138
[<ffffffff8037d260>] is_pci_dock_device+0x0/0x20
[<ffffffff8037d260>] is_pci_dock_device+0x0/0x20
[<ffffffff80394a9e>] acpi_walk_namespace+0x5f/0x83
[<ffffffff8037dd33>] detect_ejectable_slots+0x53/0x70
[<ffffffff8037de38>] add_bridge+0xe8/0x200
[<ffffffff80394aaa>] acpi_walk_namespace+0x6b/0x83
[<ffffffff803a4ad1>] acpi_pci_register_driver+0x48/0x61
[<ffffffff806fc5df>] acpiphp_init+0x0/0x58
[<ffffffff806fc732>] acpiphp_glue_init+0x4c/0x5a
[<ffffffff806fc616>] acpiphp_init+0x37/0x58
[<ffffffff8020903b>] _stext+0x3b/0x180
[<ffffffff80312598>] create_proc_entry+0x58/0xa0
[<ffffffff802815d1>] register_irq_proc+0xc1/0xe0
[<ffffffff806db64b>] kernel_init+0x152/0x1ac
[<ffffffff8023d970>] finish_task_switch+0x0/0x110
[<ffffffff8020ca7a>] child_rip+0xa/0x20
[<ffffffff8020c47c>] restore_args+0x0/0x30
[<ffffffff806db4f9>] kernel_init+0x0/0x1ac
[<ffffffff8020ca70>] child_rip+0x0/0x20
Code: 89 c2 48 8b 00 48 85 c0 75 f5 48 8b 45 00 48 89 02 44 88 65 09 48 89 5d 00 31 c0 5b 5d 41 5c c3 53 48 85 d2 89 fb 48 89 d7 75 06 <48> 8b 56 10 eb 08 e8 73 f1 ff ff 48 89 c2 85 db 74 1a eb 13 0f
RIP [<ffffffff8039646f>] acpi_ns_get_next_node+0xb/0x3c
RSP <ffff88007f87fd30>
CR2: 0000000000000010
---[ end trace a7919e7f17c0a725 ]---
Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
---
include/linux/pci-acpi.h | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
Index: linux-2.6.29-rc2/include/linux/pci-acpi.h
===================================================================
--- linux-2.6.29-rc2.orig/include/linux/pci-acpi.h
+++ linux-2.6.29-rc2/include/linux/pci-acpi.h
@@ -63,11 +63,10 @@ static inline acpi_handle acpi_find_root
static inline acpi_handle acpi_pci_get_bridge_handle(struct pci_bus *pbus)
{
- int seg = pci_domain_nr(pbus), busnr = pbus->number;
- struct pci_dev *bridge = pbus->self;
- if (bridge)
- return DEVICE_ACPI_HANDLE(&(bridge->dev));
- return acpi_get_pci_rootbridge_handle(seg, busnr);
+ if (pbus->parent)
+ return DEVICE_ACPI_HANDLE(&(pbus->self->dev));
+ return acpi_get_pci_rootbridge_handle(pci_domain_nr(pbus),
+ pbus->number);
}
#else
#if !defined(AE_ERROR)
next prev parent reply other threads:[~2009-01-28 11:49 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-10 16:17 ACPI hotplug panic with current git head James Bottomley
2009-01-12 21:16 ` Len Brown
2009-01-13 0:48 ` James Bottomley
2009-01-13 3:40 ` Len Brown
2009-01-15 19:01 ` James Bottomley
2009-01-15 19:22 ` Len Brown
2009-01-15 19:54 ` James Bottomley
2009-01-15 20:12 ` James Bottomley
2009-01-16 6:07 ` Kenji Kaneshige
2009-01-16 14:19 ` James Bottomley
2009-01-19 1:10 ` Kenji Kaneshige
2009-01-19 1:23 ` James Bottomley
2009-01-19 3:11 ` Kenji Kaneshige
2009-01-21 17:26 ` James Bottomley
2009-01-26 2:11 ` Kenji Kaneshige
2009-01-26 6:21 ` Grant Grundler
2009-01-26 12:27 ` Kenji Kaneshige
2009-01-28 11:47 ` Kenji Kaneshige
2009-01-28 11:48 ` Kenji Kaneshige [this message]
2009-01-28 11:50 ` [PATCH 2/8] PCI/ACPI: fix wrong assumption in acpi_find_root_bridge_handle Kenji Kaneshige
2009-01-28 11:51 ` [PATCH 3/8] PCI hotplug: fix wrong assumption in acpi_get_hp_params_from_firmware Kenji Kaneshige
2009-01-28 11:55 ` [PATCH 4/8] PCI hotplug: fix wrong assumption in acpi_get_hp_hw_control_from_firmware Kenji Kaneshige
2009-01-28 11:56 ` [PATCH 5/8] PCI: fix wrong assumption in pci_find_upstream_pcie_bridge Kenji Kaneshige
2009-01-28 11:57 ` [PATCH 6/8] PCI: fix wrong assumption in pci_read_bridge_bases Kenji Kaneshige
2009-01-28 11:58 ` [PATCH 7/8] PCI: fix wrong assumption in pci_get_interrupt_pin Kenji Kaneshige
2009-01-28 11:59 ` [PATCH 8/8] PCI: fix wrong assumption in pci_common_swizzle Kenji Kaneshige
2009-01-28 12:05 ` ACPI hotplug panic with current git head Kenji Kaneshige
2009-02-14 0:30 ` Jesse Barnes
[not found] ` <499A46CC.1020102@jp.fujitsu.com>
2009-02-18 18:59 ` Jesse Barnes
2009-02-18 19:08 ` James Bottomley
2009-02-18 19:41 ` Jesse Barnes
2009-03-02 17:07 ` James Bottomley
2009-01-16 20:08 ` Len Brown
2009-01-16 20:22 ` Jesse Barnes
2009-01-19 1:15 ` Kenji Kaneshige
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=4980462A.7080507@jp.fujitsu.com \
--to=kaneshige.kenji@jp.fujitsu.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=grundler@parisc-linux.org \
--cc=jesse.barnes@intel.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=shaohua.li@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