Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/acpica/dist/namespace avoid dereferencing a...



details:   https://anonhg.NetBSD.org/src/rev/5eb9b3986df1
branches:  trunk
changeset: 379411:5eb9b3986df1
user:      chs <chs%NetBSD.org@localhost>
date:      Sun May 30 16:25:35 2021 +0000

description:
avoid dereferencing a constant string address as a UINT32 pointer,
KUBSAN complains about bad alignment.

Reported-by: syzbot+91187f4e33436ce83e56%syzkaller.appspotmail.com@localhost

diffstat:

 sys/external/bsd/acpica/dist/namespace/nsaccess.c |  4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diffs (21 lines):

diff -r f4b9d3e26801 -r 5eb9b3986df1 sys/external/bsd/acpica/dist/namespace/nsaccess.c
--- a/sys/external/bsd/acpica/dist/namespace/nsaccess.c Sun May 30 14:06:37 2021 +0000
+++ b/sys/external/bsd/acpica/dist/namespace/nsaccess.c Sun May 30 16:25:35 2021 +0000
@@ -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;



Home | Main Index | Thread Index | Old Index