Add two patches to deal with arch-specific issues on ARMv7 and s390x

Signed-off-by: Al Stone <ahs3@redhat.com>
This commit is contained in:
Al Stone 2020-02-25 11:00:37 -07:00
parent c482290009
commit a203640b28
3 changed files with 63 additions and 1 deletions

View File

@ -48,6 +48,8 @@ Patch20: aslcodegen.patch
Patch21: facp.patch
Patch22: dup-symbol.patch
Patch23: no-common.patch
Patch24: utstring.patch
Patch25: dbtest.patch
BuildRequires: bison patchutils flex gcc
@ -123,6 +125,8 @@ gzip -dc %{SOURCE1} | tar -x --strip-components=1 -f -
%patch21 -p1 -b .facp
%patch22 -p1 -b .dup-symbol
%patch23 -p1 -b .no-common
%patch24 -p1 -b .utstring
%patch25 -p1 -b .dbtest
cp -p %{SOURCE2} README.Fedora
cp -p %{SOURCE3} iasl.1
@ -239,8 +243,11 @@ fi
%changelog
* Mon Feb 24 2020 Al Stone <ahs3@redhat.com> - 20200214-1
* Tue Feb 25 2020 Al Stone <ahs3@redhat.com> - 20200214-1
- Update to 20200214 source tree, including patch refreshes
- Add patches to fix an ARMv7 specific issue (utstring) and
an s390x specific issue (dbtest), both involving more careful
checks of array sizes
* Mon Feb 24 2020 Al Stone <ahs3@redhat.com> - 20200110-1
- Update to 20200110 source tree, including patch refreshes

39
dbtest.patch Normal file
View File

@ -0,0 +1,39 @@
On s390, GCC does not like the string initialization in this case. When
ValueToWrite is initialized this way, GCC tries to copy the entire string
into an ACPI_OBJECT instead of just the pointer (see the use in the call
to memcpy()). So, move the init so GCC recognizes that ValueToWrite is
only a pointer, and not a whole string that needs to be moved.
diff -Naur acpica-unix2-20200214.orig/source/components/debugger/dbtest.c acpica-unix2-20200214/source/components/debugger/dbtest.c
--- acpica-unix2-20200214.orig/source/components/debugger/dbtest.c 2020-02-14 10:33:54.000000000 -0700
+++ acpica-unix2-20200214/source/components/debugger/dbtest.c 2020-02-25 10:50:42.793372070 -0700
@@ -719,9 +719,10 @@
ACPI_OBJECT *Temp1 = NULL;
ACPI_OBJECT *Temp2 = NULL;
ACPI_OBJECT *Temp3 = NULL;
- char *ValueToWrite = "Test String from AML Debugger";
+ char *ValueToWrite = NULL;
ACPI_OBJECT WriteValue;
ACPI_STATUS Status;
+ const char *TestStr = "Test String from AML Debugger";
/* Read the original value */
@@ -737,6 +738,9 @@
/* Write a new value */
+ ValueToWrite = AcpiOsAllocateZeroed(strlen(TestStr)+1);
+ strncpy(ValueToWrite, TestStr, strlen(TestStr));
+
WriteValue.Type = ACPI_TYPE_STRING;
WriteValue.String.Length = strlen (ValueToWrite);
WriteValue.String.Pointer = ValueToWrite;
@@ -790,6 +794,7 @@
if (Temp1) {AcpiOsFree (Temp1);}
if (Temp2) {AcpiOsFree (Temp2);}
if (Temp3) {AcpiOsFree (Temp3);}
+ if (ValueToWrite) {AcpiOsFree (ValueToWrite);}
return (Status);
}

16
utstring.patch Normal file
View File

@ -0,0 +1,16 @@
On ARMv7, GCC catches this particular problem and reports trying
to copy a string into a space too small; it counts the terminating
NULL as part of the char[].
diff -Naur acpica-unix2-20200214.orig/source/components/utilities/utstring.c acpica-unix2-20200214/source/components/utilities/utstring.c
--- acpica-unix2-20200214.orig/source/components/utilities/utstring.c 2020-02-14 10:33:55.000000000 -0700
+++ acpica-unix2-20200214/source/components/utilities/utstring.c 2020-02-24 16:52:24.623218044 -0700
@@ -185,7 +185,7 @@
{
UINT32 i;
BOOLEAN FoundBadChar = FALSE;
- UINT32 OriginalName;
+ char OriginalName[ACPI_NAMESEG_SIZE+1];
ACPI_FUNCTION_NAME (UtRepairName);