<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/acpi/utilities/utalloc.c, branch master</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>ACPICA: create acpica/ directory</title>
<updated>2009-01-09T08:30:47+00:00</updated>
<author>
<name>Len Brown</name>
<email>len.brown@intel.com</email>
</author>
<published>2009-01-09T05:13:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=95b482a8d31116f3f5c2a5089569393234d06385'/>
<id>95b482a8d31116f3f5c2a5089569393234d06385</id>
<content type='text'>
also, delete sleep/ and delete ACPI_CFLAGS from Makefile

Signed-off-by: Len Brown &lt;len.brown@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
also, delete sleep/ and delete ACPI_CFLAGS from Makefile

Signed-off-by: Len Brown &lt;len.brown@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ACPICA: Restructure includes into public/private</title>
<updated>2008-12-31T06:15:40+00:00</updated>
<author>
<name>Bob Moore</name>
<email>robert.moore@intel.com</email>
</author>
<published>2008-12-30T19:01:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=50df4d8b0f6e1971b930f3158c9ee0e4263e636d'/>
<id>50df4d8b0f6e1971b930f3158c9ee0e4263e636d</id>
<content type='text'>
acpi.h now includes only the "public" acpica headers. All other
acpica headers are "private" and should not be included by acpica
users. One new file, accommon.h is used to include the commonly
used private headers for acpica code generation. Future plans
are to move all private headers to a new subdirectory.

Signed-off-by: Bob Moore &lt;robert.moore@intel.com&gt;
Signed-off-by: Lin Ming &lt;ming.m.lin@intel.com&gt;
Signed-off-by: Len Brown &lt;len.brown@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
acpi.h now includes only the "public" acpica headers. All other
acpica headers are "private" and should not be included by acpica
users. One new file, accommon.h is used to include the commonly
used private headers for acpica code generation. Future plans
are to move all private headers to a new subdirectory.

Signed-off-by: Bob Moore &lt;robert.moore@intel.com&gt;
Signed-off-by: Lin Ming &lt;ming.m.lin@intel.com&gt;
Signed-off-by: Len Brown &lt;len.brown@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ACPICA: Optimize buffer allocation procedure</title>
<updated>2008-10-23T03:14:48+00:00</updated>
<author>
<name>Bob Moore</name>
<email>robert.moore@intel.com</email>
</author>
<published>2008-09-27T03:34:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=68e125c40597802b9789bc696775bf0246e7667d'/>
<id>68e125c40597802b9789bc696775bf0246e7667d</id>
<content type='text'>
Eliminate duplicate code.

Signed-off-by: Bob Moore &lt;robert.moore@intel.com&gt;
Signed-off-by: Lin Ming &lt;ming.m.lin@intel.com&gt;
Signed-off-by: Len Brown &lt;len.brown@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Eliminate duplicate code.

Signed-off-by: Bob Moore &lt;robert.moore@intel.com&gt;
Signed-off-by: Lin Ming &lt;ming.m.lin@intel.com&gt;
Signed-off-by: Len Brown &lt;len.brown@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ACPICA: Additional error checking for pathname utilities</title>
<updated>2008-08-15T00:12:16+00:00</updated>
<author>
<name>Bob Moore</name>
<email>robert.moore@intel.com</email>
</author>
<published>2008-08-04T03:13:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=3c7db22a194d3b53584047425af82b4e1e03d9f7'/>
<id>3c7db22a194d3b53584047425af82b4e1e03d9f7</id>
<content type='text'>
Add error check after all calls to acpi_ns_get_pathname_length.
Add status return from acpi_ns_build_external_path and check after
all calls.  Add parameter validation to acpi_ut_initialize_buffer.

Reported by and initial patch by Ingo Molnar.
http://lkml.org/lkml/2008/7/21/176

Signed-off-by: Bob Moore &lt;robert.moore@intel.com&gt;
Signed-off-by: Lin Ming &lt;ming.m.lin@intel.com&gt;
Signed-off-by: Andi Kleen &lt;ak@linux.intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add error check after all calls to acpi_ns_get_pathname_length.
Add status return from acpi_ns_build_external_path and check after
all calls.  Add parameter validation to acpi_ut_initialize_buffer.

Reported by and initial patch by Ingo Molnar.
http://lkml.org/lkml/2008/7/21/176

Signed-off-by: Bob Moore &lt;robert.moore@intel.com&gt;
Signed-off-by: Lin Ming &lt;ming.m.lin@intel.com&gt;
Signed-off-by: Andi Kleen &lt;ak@linux.intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>acpi: fix crash in core ACPI code, triggered by CONFIG_ACPI_PCI_SLOT=y</title>
<updated>2008-07-21T22:27:48+00:00</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@elte.hu</email>
</author>
<published>2008-07-21T13:57:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=f88133d76ea38761b7379d6233b752ed82250a4a'/>
<id>f88133d76ea38761b7379d6233b752ed82250a4a</id>
<content type='text'>
-tip testing found the following boot crash on 32-bit x86 (Core2Duo
laptop) yesterday:

[    5.606664] scsi4 : ata_piix
[    5.606664] scsi5 : ata_piix
[    5.606664] ACPI Error (psargs-0358): [\_SB_.PCI0.LPC_.EC__.BSTA] Namespace lookup failure, AE_NOT_FOUND
[    5.606664] ACPI Error (psparse-0530): ACPI Error (nsnames-0186): Invalid NS Node (f7c0e960) while traversing path [20080609]
[    5.606664] BUG: unable to handle kernel NULL pointer dereference at 0000000f
[    5.606664] IP: [&lt;80339e2f&gt;] acpi_ns_build_external_path+0x1f/0x80
[    5.609997] *pdpt = 0000000000a03001 *pde = 0000000000000000
[    5.609997] Oops: 0002 [#1] SMP
[    5.609997]
[    5.609997] Pid: 1, comm: swapper Not tainted (2.6.26-tip-03965-gbbfb62e-dirty #3153)
[    5.609997] EIP: 0060:[&lt;80339e2f&gt;] EFLAGS: 00010286 CPU: 0
[    5.609997] EIP is at acpi_ns_build_external_path+0x1f/0x80
[    5.609997] EAX: f7c18c18 EBX: ffffffff ECX: 00000010 EDX: 00000000
[    5.609997] ESI: f7c18c18 EDI: 00000010 EBP: f7c4dc28 ESP: f7c4dc18
[    5.609997]  DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068
[    5.609997] Process swapper (pid: 1, ti=f7c4c000 task=f7c50000 task.ti=f7c4c000)
[    5.609997] Stack: 00000000 00000000 f7c18c18 f7c4dc48 f7c4dc40 80339ed0 00000000 f7c18c18
[    5.609997]        8084c1b6 8084c1b6 f7c4dc58 8033a60a 00000000 00000010 00000000 f7c18c18
[    5.609997]        f7c4dc70 8033a68f f7c18c18 00000000 f6de7600 00000005 f7c4dc98 8033c34d
[    5.609997] Call Trace:
[    5.609997]  [&lt;80339ed0&gt;] ? acpi_ns_handle_to_pathname+0x40/0x72
[    5.609997]  [&lt;8033a60a&gt;] ? acpi_ns_print_node_pathname+0x2c/0x61
[    5.609997]  [&lt;8033a68f&gt;] ? acpi_ns_report_method_error+0x50/0x6d
[    5.609997]  [&lt;8033c34d&gt;] ? acpi_ps_parse_aml+0x149/0x2f9
[    5.609997]  [&lt;8033d6dd&gt;] ? acpi_ps_execute_method+0x132/0x201
[    5.609997]  [&lt;80339d19&gt;] ? acpi_ns_evaluate+0x1ad/0x258
[    5.609997]  [&lt;803406c4&gt;] ? acpi_ut_evaluate_object+0x55/0x18f
[    5.609997]  [&lt;803408b7&gt;] ? acpi_ut_execute_STA+0x22/0x7a
[    5.609997]  [&lt;8033a907&gt;] ? acpi_get_object_info+0x131/0x1be
[    5.609997]  [&lt;80344bb2&gt;] ? do_acpi_find_child+0x22/0x4b
[    5.609997]  [&lt;8033b855&gt;] ? acpi_ns_walk_namespace+0xa5/0x124
[    5.609997]  [&lt;803394f3&gt;] ? acpi_walk_namespace+0x54/0x74
[    5.609997]  [&lt;80344b90&gt;] ? do_acpi_find_child+0x0/0x4b
[    5.609997]  [&lt;80344b85&gt;] ? acpi_get_child+0x38/0x43
[    5.609997]  [&lt;80344b90&gt;] ? do_acpi_find_child+0x0/0x4b
[    5.609997]  [&lt;804d0148&gt;] ? ata_acpi_associate+0xb5/0x1b5
[    5.609997]  [&lt;804c6ecb&gt;] ? ata_scsi_add_hosts+0x8e/0xdc
[    5.609997]  [&lt;804c40c8&gt;] ? ata_host_register+0x9f/0x1d6
[    5.609997]  [&lt;804cbc7f&gt;] ? ata_pci_sff_activate_host+0x179/0x19f
[    5.609997]  [&lt;804cdd45&gt;] ? ata_sff_interrupt+0x0/0x1c7
[    5.609997]  [&lt;8069b033&gt;] ? piix_init_one+0x569/0x5b0
[    5.609997]  [&lt;801bd400&gt;] ? sysfs_ilookup_test+0x0/0x11
[    5.609997]  [&lt;801987d7&gt;] ? ilookup5_nowait+0x29/0x30
[    5.609997]  [&lt;802efc7e&gt;] ? pci_match_device+0x99/0xa3
[    5.609997]  [&lt;802efd3c&gt;] ? pci_device_probe+0x39/0x59
[    5.609997]  [&lt;803bc4af&gt;] ? driver_probe_device+0xa0/0x11b
[    5.609997]  [&lt;803bc564&gt;] ? __driver_attach+0x3a/0x59
[    5.609997]  [&lt;803bbde3&gt;] ? bus_for_each_dev+0x36/0x58
[    5.609997]  [&lt;803bc354&gt;] ? driver_attach+0x14/0x16
[    5.609997]  [&lt;803bc52a&gt;] ? __driver_attach+0x0/0x59
[    5.609997]  [&lt;803bc161&gt;] ? bus_add_driver+0x93/0x196
[    5.609997]  [&lt;803bc773&gt;] ? driver_register+0x71/0xcd
[    5.609997]  [&lt;802eff05&gt;] ? __pci_register_driver+0x3f/0x6e
[    5.609997]  [&lt;809af7ff&gt;] ? piix_init+0x14/0x24
[    5.609997]  [&lt;80984568&gt;] ? kernel_init+0x128/0x269
[    5.609997]  [&lt;809af7eb&gt;] ? piix_init+0x0/0x24
[    5.609997]  [&lt;802e2758&gt;] ? trace_hardirqs_on_thunk+0xc/0x10
[    5.609997]  [&lt;80116aef&gt;] ? restore_nocheck_notrace+0x0/0xe
[    5.609997]  [&lt;80984440&gt;] ? kernel_init+0x0/0x269
[    5.609997]  [&lt;80984440&gt;] ? kernel_init+0x0/0x269
[    5.609997]  [&lt;80117d87&gt;] ? kernel_thread_helper+0x7/0x10
[    5.609997]  =======================
[    5.609997] Code: 75 02 b3 01 8d 43 01 8b 5d fc c9 c3 55 89 e5 57 89 cf 56 53 89 d3 4b 83 ec 04 83 fb 03 89 55 f0 77 09 c6 01 5c c6 41 01 00 eb 59 &lt;c6&gt; 04 19 00 8b 55 f0 8d 34 11 89 c2 eb 19 8b 42 08 83 eb 05 89
[    5.609997] EIP: [&lt;80339e2f&gt;] acpi_ns_build_external_path+0x1f/0x80 SS:ESP 0068:f7c4dc18
[    5.613331] Kernel panic - not syncing: Fatal exception
[    5.613331] Rebooting in 1 seconds..[    4.646664] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)

I have bisected it down to:

 # bad:  [5b664cbe] Merge branch 'upstream-linus' of git://git.kernel.
 # good: [bce7f795] Linux 2.6.26
 # good: [e18425ab] Merge branch 'tracing/for-linus' of git://git.kern
 # good: [cadc7236] Merge branch 'bkl-removal' into next
 # good: [4515889a] Merge branch 'merge' of git://git.kernel.org/pub/s
 # good: [42fdd14e] Merge git://git.kernel.org/pub/scm/linux/kernel/gi
 # good: [8a0ca91f] Merge branch 'for-linus' of git://git.kernel.org/p
 # bad:  [0af4b8cb] ACPI: Introduce new device wakeup flag 'prepared'
 # good: [fe997407] PCI: construct one fakephp slot per PCI slot
 # bad:  [531f254a] PCIE: aer: use dev_printk when possible
 # bad:  [15650a20] x86/PCI: fixup early quirk probing
 # good: [0e6859d9] ACPI PM: Remove obsolete Toshiba workaround
 # bad:  [8344b566] PCI: ACPI PCI slot detection driver
 # good: [f46753c9] PCI: introduce pci_slot

 | 8344b568f5bdc7ee1bba909de3294c6348c36056 is first bad commit
 | commit 8344b568f5bdc7ee1bba909de3294c6348c36056
 | Author: Alex Chiang &lt;achiang@hp.com&gt;
 | Date:   Tue Jun 10 15:30:42 2008 -0600
 |
 |     PCI: ACPI PCI slot detection driver
 |
 |     Detect all physical PCI slots as described by ACPI, and create entries in
 |     /sys/bus/pci/slots/.

I.e. the new CONFIG_ACPI_PCI_SLOT=y option was causing this crash.

But the bug is not mainly in this new PCI code - that code was just
hitting the ACPI code in a new way which made ACPI break.

The crash signature shows that we are crashing on this instruction:

   movb $0x0, (%ecx, %ebx, 1)

ECX and EBX are 0x10 and -1. It's this line in
drivers/acpi/namespace/nsnames.c's acpi_ns_build_external_path():

        name_buffer[index] = 0;

I.e. name_buffer is 0x10 and index is -1.

index -1 corresponds to size 0, and name_buffer 0x10 is slab's
ZERO_SIZE_PTR special-case for zero-sized allocations.

I.e. when we called acpi_ns_handle_to_pathname(), we got required_size
of 0 due to an error condition, but this is passed to the ACPI allocator
unconditionally:

        required_size = acpi_ns_get_pathname_length(node);

        /* Validate/Allocate/Clear caller buffer */

        status = acpi_ut_initialize_buffer(buffer, required_size);
        if (ACPI_FAILURE(status)) {
                return_ACPI_STATUS(status);
        }

Where acpi_ut_initialize_buffer(), through many (unnecessary) layers,
ends up calling kzalloc(0). Which returns 0x10 and that then causes the
crash later on.

So fix both callers of acpi_ns_get_pathname_length(), which can return 0
in case of an invalid node.

Also add a WARN_ON() against zero sized allocations in
acpi_ut_initialize_buffer() to make it easier to find similar instances
of this bug.

I have tested this patch for the past 24 hours and the crash has not
reappeared.

Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Andi Kleen &lt;ak@linux.intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
-tip testing found the following boot crash on 32-bit x86 (Core2Duo
laptop) yesterday:

[    5.606664] scsi4 : ata_piix
[    5.606664] scsi5 : ata_piix
[    5.606664] ACPI Error (psargs-0358): [\_SB_.PCI0.LPC_.EC__.BSTA] Namespace lookup failure, AE_NOT_FOUND
[    5.606664] ACPI Error (psparse-0530): ACPI Error (nsnames-0186): Invalid NS Node (f7c0e960) while traversing path [20080609]
[    5.606664] BUG: unable to handle kernel NULL pointer dereference at 0000000f
[    5.606664] IP: [&lt;80339e2f&gt;] acpi_ns_build_external_path+0x1f/0x80
[    5.609997] *pdpt = 0000000000a03001 *pde = 0000000000000000
[    5.609997] Oops: 0002 [#1] SMP
[    5.609997]
[    5.609997] Pid: 1, comm: swapper Not tainted (2.6.26-tip-03965-gbbfb62e-dirty #3153)
[    5.609997] EIP: 0060:[&lt;80339e2f&gt;] EFLAGS: 00010286 CPU: 0
[    5.609997] EIP is at acpi_ns_build_external_path+0x1f/0x80
[    5.609997] EAX: f7c18c18 EBX: ffffffff ECX: 00000010 EDX: 00000000
[    5.609997] ESI: f7c18c18 EDI: 00000010 EBP: f7c4dc28 ESP: f7c4dc18
[    5.609997]  DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068
[    5.609997] Process swapper (pid: 1, ti=f7c4c000 task=f7c50000 task.ti=f7c4c000)
[    5.609997] Stack: 00000000 00000000 f7c18c18 f7c4dc48 f7c4dc40 80339ed0 00000000 f7c18c18
[    5.609997]        8084c1b6 8084c1b6 f7c4dc58 8033a60a 00000000 00000010 00000000 f7c18c18
[    5.609997]        f7c4dc70 8033a68f f7c18c18 00000000 f6de7600 00000005 f7c4dc98 8033c34d
[    5.609997] Call Trace:
[    5.609997]  [&lt;80339ed0&gt;] ? acpi_ns_handle_to_pathname+0x40/0x72
[    5.609997]  [&lt;8033a60a&gt;] ? acpi_ns_print_node_pathname+0x2c/0x61
[    5.609997]  [&lt;8033a68f&gt;] ? acpi_ns_report_method_error+0x50/0x6d
[    5.609997]  [&lt;8033c34d&gt;] ? acpi_ps_parse_aml+0x149/0x2f9
[    5.609997]  [&lt;8033d6dd&gt;] ? acpi_ps_execute_method+0x132/0x201
[    5.609997]  [&lt;80339d19&gt;] ? acpi_ns_evaluate+0x1ad/0x258
[    5.609997]  [&lt;803406c4&gt;] ? acpi_ut_evaluate_object+0x55/0x18f
[    5.609997]  [&lt;803408b7&gt;] ? acpi_ut_execute_STA+0x22/0x7a
[    5.609997]  [&lt;8033a907&gt;] ? acpi_get_object_info+0x131/0x1be
[    5.609997]  [&lt;80344bb2&gt;] ? do_acpi_find_child+0x22/0x4b
[    5.609997]  [&lt;8033b855&gt;] ? acpi_ns_walk_namespace+0xa5/0x124
[    5.609997]  [&lt;803394f3&gt;] ? acpi_walk_namespace+0x54/0x74
[    5.609997]  [&lt;80344b90&gt;] ? do_acpi_find_child+0x0/0x4b
[    5.609997]  [&lt;80344b85&gt;] ? acpi_get_child+0x38/0x43
[    5.609997]  [&lt;80344b90&gt;] ? do_acpi_find_child+0x0/0x4b
[    5.609997]  [&lt;804d0148&gt;] ? ata_acpi_associate+0xb5/0x1b5
[    5.609997]  [&lt;804c6ecb&gt;] ? ata_scsi_add_hosts+0x8e/0xdc
[    5.609997]  [&lt;804c40c8&gt;] ? ata_host_register+0x9f/0x1d6
[    5.609997]  [&lt;804cbc7f&gt;] ? ata_pci_sff_activate_host+0x179/0x19f
[    5.609997]  [&lt;804cdd45&gt;] ? ata_sff_interrupt+0x0/0x1c7
[    5.609997]  [&lt;8069b033&gt;] ? piix_init_one+0x569/0x5b0
[    5.609997]  [&lt;801bd400&gt;] ? sysfs_ilookup_test+0x0/0x11
[    5.609997]  [&lt;801987d7&gt;] ? ilookup5_nowait+0x29/0x30
[    5.609997]  [&lt;802efc7e&gt;] ? pci_match_device+0x99/0xa3
[    5.609997]  [&lt;802efd3c&gt;] ? pci_device_probe+0x39/0x59
[    5.609997]  [&lt;803bc4af&gt;] ? driver_probe_device+0xa0/0x11b
[    5.609997]  [&lt;803bc564&gt;] ? __driver_attach+0x3a/0x59
[    5.609997]  [&lt;803bbde3&gt;] ? bus_for_each_dev+0x36/0x58
[    5.609997]  [&lt;803bc354&gt;] ? driver_attach+0x14/0x16
[    5.609997]  [&lt;803bc52a&gt;] ? __driver_attach+0x0/0x59
[    5.609997]  [&lt;803bc161&gt;] ? bus_add_driver+0x93/0x196
[    5.609997]  [&lt;803bc773&gt;] ? driver_register+0x71/0xcd
[    5.609997]  [&lt;802eff05&gt;] ? __pci_register_driver+0x3f/0x6e
[    5.609997]  [&lt;809af7ff&gt;] ? piix_init+0x14/0x24
[    5.609997]  [&lt;80984568&gt;] ? kernel_init+0x128/0x269
[    5.609997]  [&lt;809af7eb&gt;] ? piix_init+0x0/0x24
[    5.609997]  [&lt;802e2758&gt;] ? trace_hardirqs_on_thunk+0xc/0x10
[    5.609997]  [&lt;80116aef&gt;] ? restore_nocheck_notrace+0x0/0xe
[    5.609997]  [&lt;80984440&gt;] ? kernel_init+0x0/0x269
[    5.609997]  [&lt;80984440&gt;] ? kernel_init+0x0/0x269
[    5.609997]  [&lt;80117d87&gt;] ? kernel_thread_helper+0x7/0x10
[    5.609997]  =======================
[    5.609997] Code: 75 02 b3 01 8d 43 01 8b 5d fc c9 c3 55 89 e5 57 89 cf 56 53 89 d3 4b 83 ec 04 83 fb 03 89 55 f0 77 09 c6 01 5c c6 41 01 00 eb 59 &lt;c6&gt; 04 19 00 8b 55 f0 8d 34 11 89 c2 eb 19 8b 42 08 83 eb 05 89
[    5.609997] EIP: [&lt;80339e2f&gt;] acpi_ns_build_external_path+0x1f/0x80 SS:ESP 0068:f7c4dc18
[    5.613331] Kernel panic - not syncing: Fatal exception
[    5.613331] Rebooting in 1 seconds..[    4.646664] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)

I have bisected it down to:

 # bad:  [5b664cbe] Merge branch 'upstream-linus' of git://git.kernel.
 # good: [bce7f795] Linux 2.6.26
 # good: [e18425ab] Merge branch 'tracing/for-linus' of git://git.kern
 # good: [cadc7236] Merge branch 'bkl-removal' into next
 # good: [4515889a] Merge branch 'merge' of git://git.kernel.org/pub/s
 # good: [42fdd14e] Merge git://git.kernel.org/pub/scm/linux/kernel/gi
 # good: [8a0ca91f] Merge branch 'for-linus' of git://git.kernel.org/p
 # bad:  [0af4b8cb] ACPI: Introduce new device wakeup flag 'prepared'
 # good: [fe997407] PCI: construct one fakephp slot per PCI slot
 # bad:  [531f254a] PCIE: aer: use dev_printk when possible
 # bad:  [15650a20] x86/PCI: fixup early quirk probing
 # good: [0e6859d9] ACPI PM: Remove obsolete Toshiba workaround
 # bad:  [8344b566] PCI: ACPI PCI slot detection driver
 # good: [f46753c9] PCI: introduce pci_slot

 | 8344b568f5bdc7ee1bba909de3294c6348c36056 is first bad commit
 | commit 8344b568f5bdc7ee1bba909de3294c6348c36056
 | Author: Alex Chiang &lt;achiang@hp.com&gt;
 | Date:   Tue Jun 10 15:30:42 2008 -0600
 |
 |     PCI: ACPI PCI slot detection driver
 |
 |     Detect all physical PCI slots as described by ACPI, and create entries in
 |     /sys/bus/pci/slots/.

I.e. the new CONFIG_ACPI_PCI_SLOT=y option was causing this crash.

But the bug is not mainly in this new PCI code - that code was just
hitting the ACPI code in a new way which made ACPI break.

The crash signature shows that we are crashing on this instruction:

   movb $0x0, (%ecx, %ebx, 1)

ECX and EBX are 0x10 and -1. It's this line in
drivers/acpi/namespace/nsnames.c's acpi_ns_build_external_path():

        name_buffer[index] = 0;

I.e. name_buffer is 0x10 and index is -1.

index -1 corresponds to size 0, and name_buffer 0x10 is slab's
ZERO_SIZE_PTR special-case for zero-sized allocations.

I.e. when we called acpi_ns_handle_to_pathname(), we got required_size
of 0 due to an error condition, but this is passed to the ACPI allocator
unconditionally:

        required_size = acpi_ns_get_pathname_length(node);

        /* Validate/Allocate/Clear caller buffer */

        status = acpi_ut_initialize_buffer(buffer, required_size);
        if (ACPI_FAILURE(status)) {
                return_ACPI_STATUS(status);
        }

Where acpi_ut_initialize_buffer(), through many (unnecessary) layers,
ends up calling kzalloc(0). Which returns 0x10 and that then causes the
crash later on.

So fix both callers of acpi_ns_get_pathname_length(), which can return 0
in case of an invalid node.

Also add a WARN_ON() against zero sized allocations in
acpi_ut_initialize_buffer() to make it easier to find similar instances
of this bug.

I have tested this patch for the past 24 hours and the crash has not
reappeared.

Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Andi Kleen &lt;ak@linux.intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ACPICA: Add const qualifier for appropriate string constants</title>
<updated>2008-07-16T21:27:04+00:00</updated>
<author>
<name>Bob Moore</name>
<email>robert.moore@intel.com</email>
</author>
<published>2008-06-10T05:55:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=4b8ed631679070c183c8ae7519d2bdb9df124ae4'/>
<id>4b8ed631679070c183c8ae7519d2bdb9df124ae4</id>
<content type='text'>
Mostly MODULE_NAME and printf format strings.

Signed-off-by: Bob Moore &lt;robert.moore@intel.com&gt;
Signed-off-by: Lin Ming &lt;ming.m.lin@intel.com&gt;
Signed-off-by: Len Brown &lt;len.brown@intel.com&gt;
Signed-off-by: Andi Kleen &lt;ak@linux.intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Mostly MODULE_NAME and printf format strings.

Signed-off-by: Bob Moore &lt;robert.moore@intel.com&gt;
Signed-off-by: Lin Ming &lt;ming.m.lin@intel.com&gt;
Signed-off-by: Len Brown &lt;len.brown@intel.com&gt;
Signed-off-by: Andi Kleen &lt;ak@linux.intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ACPICA: update Intel copyright</title>
<updated>2008-04-24T03:00:13+00:00</updated>
<author>
<name>Len Brown</name>
<email>len.brown@intel.com</email>
</author>
<published>2008-04-24T03:00:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=75a44ce00b312f57264f42a0a985d17cd9994b98'/>
<id>75a44ce00b312f57264f42a0a985d17cd9994b98</id>
<content type='text'>
Signed-off-by: Len Brown &lt;len.brown@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Len Brown &lt;len.brown@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ACPICA: Cosmetic changes only, no functional changes</title>
<updated>2008-04-22T18:29:27+00:00</updated>
<author>
<name>Bob Moore</name>
<email>robert.moore@intel.com</email>
</author>
<published>2008-04-10T15:06:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=1d18c05825c3f2b8933a7fc7f7528881e98deb04'/>
<id>1d18c05825c3f2b8933a7fc7f7528881e98deb04</id>
<content type='text'>
Lint changes, fix compiler warnings, etc.

Signed-off-by: Bob Moore &lt;robert.moore@intel.com&gt;
Signed-off-by: Alexey Starikovskiy &lt;astarikovskiy@suse.de&gt;
Signed-off-by: Len Brown &lt;len.brown@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Lint changes, fix compiler warnings, etc.

Signed-off-by: Bob Moore &lt;robert.moore@intel.com&gt;
Signed-off-by: Alexey Starikovskiy &lt;astarikovskiy@suse.de&gt;
Signed-off-by: Len Brown &lt;len.brown@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ACPICA: Lindent</title>
<updated>2007-05-10T03:34:35+00:00</updated>
<author>
<name>Len Brown</name>
<email>len.brown@intel.com</email>
</author>
<published>2007-05-10T03:34:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=fd3509436fde38d4c854bf5a6b83d2c779904f8e'/>
<id>fd3509436fde38d4c854bf5a6b83d2c779904f8e</id>
<content type='text'>
Signed-off-by: Len Brown &lt;len.brown@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Len Brown &lt;len.brown@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ACPICA: Update copyright to 2007.</title>
<updated>2007-02-03T02:14:31+00:00</updated>
<author>
<name>Bob Moore</name>
<email>robert.moore@intel.com</email>
</author>
<published>2007-02-02T16:48:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=6c9deb7201d96733dcd1b4cc44e99232308db359'/>
<id>6c9deb7201d96733dcd1b4cc44e99232308db359</id>
<content type='text'>
Added 2007 copyright to all module headers and signons. This affects
virtually every file in the ACPICA core subsystem, iASL compiler,
and the utilities.

Signed-off-by: Alexey Starikovskiy &lt;alexey.y.starikovskiy@intel.com&gt;
Signed-off-by: Len Brown &lt;len.brown@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Added 2007 copyright to all module headers and signons. This affects
virtually every file in the ACPICA core subsystem, iASL compiler,
and the utilities.

Signed-off-by: Alexey Starikovskiy &lt;alexey.y.starikovskiy@intel.com&gt;
Signed-off-by: Len Brown &lt;len.brown@intel.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
