Module Name: src Committed By: chs Date: Sun May 30 16:25:35 UTC 2021
Modified Files: src/sys/external/bsd/acpica/dist/namespace: nsaccess.c Log Message: avoid dereferencing a constant string address as a UINT32 pointer, KUBSAN complains about bad alignment. Reported-by: syzbot+91187f4e33436ce83...@syzkaller.appspotmail.com To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 \ src/sys/external/bsd/acpica/dist/namespace/nsaccess.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/external/bsd/acpica/dist/namespace/nsaccess.c diff -u src/sys/external/bsd/acpica/dist/namespace/nsaccess.c:1.20 src/sys/external/bsd/acpica/dist/namespace/nsaccess.c:1.21 --- src/sys/external/bsd/acpica/dist/namespace/nsaccess.c:1.20 Sat Apr 3 17:45:03 2021 +++ src/sys/external/bsd/acpica/dist/namespace/nsaccess.c Sun May 30 16:25:35 2021 @@ -79,6 +79,7 @@ AcpiNsRootInitialize ( ACPI_NAMESPACE_NODE *PrevNode = NULL; ACPI_OPERAND_OBJECT *ObjDesc; ACPI_STRING Val = NULL; + UINT32 Name; ACPI_FUNCTION_TRACE (NsRootInitialize); @@ -143,7 +144,8 @@ AcpiNsRootInitialize ( * predefined names are at the root level. It is much easier to * just create and link the new node(s) here. */ - NewNode = AcpiNsCreateNode (*ACPI_CAST_PTR (UINT32, InitVal->Name)); + memcpy(&Name, InitVal->Name, sizeof(Name)); + NewNode = AcpiNsCreateNode (Name); if (!NewNode) { Status = AE_NO_MEMORY;