Re: slub freelist issue / BUG: unable to handle page fault for address: 000000003ffe0018

From: Vegard Nossum
Date: Fri Jun 05 2020 - 12:38:46 EST


On 2020-06-05 17:44, Kees Cook wrote:
On Fri, Jun 05, 2020 at 04:44:51PM +0200, Vegard Nossum wrote:
That's it :-) This fixes it for me:

diff --git a/drivers/acpi/acpica/nsaccess.c b/drivers/acpi/acpica/nsaccess.c
index 2566e2d4c7803..b76bbab917941 100644
--- a/drivers/acpi/acpica/nsaccess.c
+++ b/drivers/acpi/acpica/nsaccess.c
@@ -98,14 +98,12 @@ acpi_status acpi_ns_root_initialize(void)
* predefined names are at the root level. It is much easier
to
* just create and link the new node(s) here.
*/
- new_node =
- ACPI_ALLOCATE_ZEROED(sizeof(struct
acpi_namespace_node));
+ new_node = acpi_ns_create_node(*ACPI_CAST_PTR (u32,
init_val->name));
if (!new_node) {
status = AE_NO_MEMORY;
goto unlock_and_exit;
}

- ACPI_COPY_NAMESEG(new_node->name.ascii, init_val->name);
new_node->descriptor_type = ACPI_DESC_TYPE_NAMED;
new_node->type = init_val->type;

I'm a bit confused by the internals of acpi_ns_create_note(). It can still
end up calling ACPI_ALLOCATE_ZEROED() via acpi_os_acquire_object(). Is
this fix correct?


include/acpi/platform/aclinuxex.h:static inline void *acpi_os_acquire_object(acpi_cache_t * cache)
include/acpi/platform/aclinuxex.h-{
include/acpi/platform/aclinuxex.h- return kmem_cache_zalloc(cache,
include/acpi/platform/aclinuxex.h- irqs_disabled()? GFP_ATOMIC : GFP_KERNEL);
include/acpi/platform/aclinuxex.h-}

No comment.


Vegard