Compare commits
10 Commits
da676f51ad
...
ab937167c9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ab937167c9 | ||
|
|
909cffb9ca | ||
|
|
d00c2feec7 | ||
|
|
98251df46a | ||
|
|
74ffc9bf15 | ||
|
|
02acf554c3 | ||
|
|
cf36658f4a | ||
|
|
69ccd19a7b | ||
|
|
77b23953ad | ||
|
|
91c17dae87 |
339
COPYING
Normal file
339
COPYING
Normal file
@ -0,0 +1,339 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
||||
92
acpica-tools.spec
Normal file
92
acpica-tools.spec
Normal file
@ -0,0 +1,92 @@
|
||||
Name: acpica-tools
|
||||
Version: 20200528
|
||||
Release: 1
|
||||
Summary: Tools for OS-independent reference implementation of ACPI
|
||||
|
||||
License: GPLv2
|
||||
URL: https://www.acpica.org/
|
||||
|
||||
Source0: https://acpica.org/sites/acpica/files/acpica-unix2-%{version}.tar.gz
|
||||
Source1: https://acpica.org/sites/acpica/files/acpitests-unix-%{version}.tar.gz
|
||||
Source2: COPYING
|
||||
|
||||
Patch0001: cve-2017-13693.patch
|
||||
Patch0002: cve-2017-13694.patch
|
||||
Patch0003: cve-2017-13695.patch
|
||||
Patch0004: openEuler-harden.patch
|
||||
|
||||
BuildRequires: bison patchutils flex gcc
|
||||
Provides: acpixtract >= 20120913-7 iasl = %{version}-%{release} acpidump >= 20100513-5
|
||||
Provides: pmtools = %{version}-%{release}
|
||||
Obsoletes: iasl < 20120913-8 pmtools < 20100513-6
|
||||
|
||||
%description
|
||||
The ACPI Component Architecture (ACPICA) project provides an operating system (OS)-independent
|
||||
reference implementation of the Advanced Configuration and Power Interface Specification (ACPI).
|
||||
It can be easily adapted to execute under any host OS. The ACPICA code is meant to be directly
|
||||
integrated into the host OS as a kernel-resident subsystem. Hosting the ACPICA subsystem requires
|
||||
no changes to the core ACPICA code. Instead, a small OS-specific interface layer is written
|
||||
specifically for each host OS in order to interface the ACPICA code to the native OS services.
|
||||
The complexity of the ACPI specification leads to a lengthy and difficult implementation in
|
||||
operating system software. The primary purpose of the ACPI Component Architecture is to simplify
|
||||
ACPI implementations for operating system vendors (OSVs) by providing major portions of an ACPI
|
||||
implementation in OS-independent ACPI modules that can be easily integrated into any OS.
|
||||
|
||||
%prep
|
||||
%autosetup -n acpica-unix2-%{version} -p1
|
||||
gzip -dc %{SOURCE1} | tar -x --strip-components=1 -f -
|
||||
|
||||
install -p %{SOURCE2} COPYING
|
||||
|
||||
chmod a-x changes.txt
|
||||
chmod a-x source/compiler/new_table.txt
|
||||
|
||||
%build
|
||||
CWARNINGFLAGS="\
|
||||
-std=c99 -Wall -Wbad-function-cast -Wdeclaration-after-statement -Werror -Wformat=2\
|
||||
-Wmissing-declarations -Wmissing-prototypes -Wstrict-aliasing=0 -Wstrict-prototypes\
|
||||
-Wswitch-default -Wpointer-arith -Wundef -Waddress -Waggregate-return -Winit-self\
|
||||
-Winline -Wmissing-declarations -Wmissing-field-initializers -Wnested-externs\
|
||||
-Wold-style-definition -Wno-format-nonliteral -Wredundant-decls -Wempty-body\
|
||||
-Woverride-init -Wlogical-op -Wmissing-parameter-type -Wold-style-declaration\
|
||||
-Wtype-limits"
|
||||
|
||||
export OPT_CFLAGS="%{optflags} $CWARNINGFLAGS"
|
||||
export OPT_LDFLAGS="%{__global_ldflags}"
|
||||
|
||||
%make_build
|
||||
|
||||
%install
|
||||
install -d %{buildroot}%{_bindir}
|
||||
install -pD generate/unix/bin*/* %{buildroot}%{_bindir}/
|
||||
|
||||
install -d %{buildroot}%{_docdir}/acpica-tools/examples
|
||||
install -pDm 0644 source/tools/examples/* %{buildroot}%{_docdir}/acpica-tools/examples/
|
||||
|
||||
%pre
|
||||
if [ -e %{_bindir}/acpixtract-acpica ];then
|
||||
alternatives --remove acpixtract %{_bindir}/acpixtract-acpica
|
||||
fi
|
||||
if [ -e %{_bindir}/acpidump-acpica ];then
|
||||
alternatives --remove acpidump %{_bindir}/acpidump-acpica
|
||||
fi
|
||||
|
||||
%postun
|
||||
if [ -e %{_bindir}/acpixtract-acpica ];then
|
||||
alternatives --remove acpixtract %{_bindir}/acpixtract-acpica
|
||||
fi
|
||||
if [ -e %{_bindir}/acpidump-acpica ];then
|
||||
alternatives --remove acpidump %{_bindir}/acpidump-acpica
|
||||
fi
|
||||
|
||||
%files
|
||||
%doc changes.txt source/compiler/new_table.txt COPYING
|
||||
%{_bindir}/*
|
||||
%{_docdir}/*
|
||||
|
||||
%changelog
|
||||
* Wed Aug 12 2020 xinghe <xinghe1@huawei.com> - 20200528-1
|
||||
- update to 20200528
|
||||
|
||||
* Tue Dec 31 2019 daiqianwen <daiqianwen@huawei.com> - 20190509-4
|
||||
- Package init
|
||||
BIN
acpica-unix2-20200528.tar.gz
Normal file
BIN
acpica-unix2-20200528.tar.gz
Normal file
Binary file not shown.
BIN
acpitests-unix-20200528.tar.gz
Normal file
BIN
acpitests-unix-20200528.tar.gz
Normal file
Binary file not shown.
99
cve-2017-13693.patch
Normal file
99
cve-2017-13693.patch
Normal file
@ -0,0 +1,99 @@
|
||||
From 987a3b5cf7175916e2a4b6ea5b8e70f830dfe732 Mon Sep 17 00:00:00 2001
|
||||
From: Seunghun Han <kkamagui@gmail.com>
|
||||
Date: Wed, 19 Jul 2017 16:47:53 +0900
|
||||
Subject: [PATCH] acpi: acpica: fix acpi operand cache leak in dswstate.c
|
||||
|
||||
I found an ACPI cache leak in ACPI early termination and boot continuing case.
|
||||
|
||||
When early termination occurs due to malicious ACPI table, Linux kernel
|
||||
terminates ACPI function and continues to boot process. While kernel terminates
|
||||
ACPI function, kmem_cache_destroy() reports Acpi-Operand cache leak.
|
||||
|
||||
Boot log of ACPI operand cache leak is as follows:
|
||||
>[ 0.585957] ACPI: Added _OSI(Module Device)
|
||||
>[ 0.587218] ACPI: Added _OSI(Processor Device)
|
||||
>[ 0.588530] ACPI: Added _OSI(3.0 _SCP Extensions)
|
||||
>[ 0.589790] ACPI: Added _OSI(Processor Aggregator Device)
|
||||
>[ 0.591534] ACPI Error: Illegal I/O port address/length above 64K: C806E00000004002/0x2 (20170303/hwvalid-155)
|
||||
>[ 0.594351] ACPI Exception: AE_LIMIT, Unable to initialize fixed events (20170303/evevent-88)
|
||||
>[ 0.597858] ACPI: Unable to start the ACPI Interpreter
|
||||
>[ 0.599162] ACPI Error: Could not remove SCI handler (20170303/evmisc-281)
|
||||
>[ 0.601836] kmem_cache_destroy Acpi-Operand: Slab cache still has objects
|
||||
>[ 0.603556] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.12.0-rc5 #26
|
||||
>[ 0.605159] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006
|
||||
>[ 0.609177] Call Trace:
|
||||
>[ 0.610063] ? dump_stack+0x5c/0x81
|
||||
>[ 0.611118] ? kmem_cache_destroy+0x1aa/0x1c0
|
||||
>[ 0.612632] ? acpi_sleep_proc_init+0x27/0x27
|
||||
>[ 0.613906] ? acpi_os_delete_cache+0xa/0x10
|
||||
>[ 0.617986] ? acpi_ut_delete_caches+0x3f/0x7b
|
||||
>[ 0.619293] ? acpi_terminate+0xa/0x14
|
||||
>[ 0.620394] ? acpi_init+0x2af/0x34f
|
||||
>[ 0.621616] ? __class_create+0x4c/0x80
|
||||
>[ 0.623412] ? video_setup+0x7f/0x7f
|
||||
>[ 0.624585] ? acpi_sleep_proc_init+0x27/0x27
|
||||
>[ 0.625861] ? do_one_initcall+0x4e/0x1a0
|
||||
>[ 0.627513] ? kernel_init_freeable+0x19e/0x21f
|
||||
>[ 0.628972] ? rest_init+0x80/0x80
|
||||
>[ 0.630043] ? kernel_init+0xa/0x100
|
||||
>[ 0.631084] ? ret_from_fork+0x25/0x30
|
||||
>[ 0.633343] vgaarb: loaded
|
||||
>[ 0.635036] EDAC MC: Ver: 3.0.0
|
||||
>[ 0.638601] PCI: Probing PCI hardware
|
||||
>[ 0.639833] PCI host bridge to bus 0000:00
|
||||
>[ 0.641031] pci_bus 0000:00: root bus resource [io 0x0000-0xffff]
|
||||
> ... Continue to boot and log is omitted ...
|
||||
|
||||
I analyzed this memory leak in detail and found acpi_ds_obj_stack_pop_and_
|
||||
delete() function miscalculated the top of the stack. acpi_ds_obj_stack_push()
|
||||
function uses walk_state->operand_index for start position of the top, but
|
||||
acpi_ds_obj_stack_pop_and_delete() function considers index 0 for it.
|
||||
Therefore, this causes acpi operand memory leak.
|
||||
|
||||
This cache leak causes a security threat because an old kernel (<= 4.9) shows
|
||||
memory locations of kernel functions in stack dump. Some malicious users
|
||||
could use this information to neutralize kernel ASLR.
|
||||
|
||||
I made a patch to fix ACPI operand cache leak.
|
||||
|
||||
Signed-off-by: Seunghun Han <kkamagui@gmail.com>
|
||||
|
||||
Github-Location: https://github.com/acpica/acpica/pull/295/commits/987a3b5cf7175916e2a4b6ea5b8e70f830dfe732
|
||||
---
|
||||
source/components/dispatcher/dsutils.c | 9 ++++++++-
|
||||
1 file changed, 8 insertions(+), 1 deletion(-)
|
||||
|
||||
Index: acpica-unix2-20181213/source/components/dispatcher/dsutils.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20181213.orig/source/components/dispatcher/dsutils.c
|
||||
+++ acpica-unix2-20181213/source/components/dispatcher/dsutils.c
|
||||
@@ -759,6 +759,8 @@ AcpiDsCreateOperands (
|
||||
ACPI_PARSE_OBJECT *Arguments[ACPI_OBJ_NUM_OPERANDS];
|
||||
UINT32 ArgCount = 0;
|
||||
UINT32 Index = WalkState->NumOperands;
|
||||
+ UINT32 PrevNumOperands = WalkState->NumOperands;
|
||||
+ UINT32 NewNumOperands;
|
||||
UINT32 i;
|
||||
|
||||
|
||||
@@ -791,6 +793,7 @@ AcpiDsCreateOperands (
|
||||
|
||||
/* Create the interpreter arguments, in reverse order */
|
||||
|
||||
+ NewNumOperands = Index;
|
||||
Index--;
|
||||
for (i = 0; i < ArgCount; i++)
|
||||
{
|
||||
@@ -818,7 +821,11 @@ Cleanup:
|
||||
* pop everything off of the operand stack and delete those
|
||||
* objects
|
||||
*/
|
||||
- AcpiDsObjStackPopAndDelete (ArgCount, WalkState);
|
||||
+ WalkState->NumOperands = i;
|
||||
+ AcpiDsObjStackPopAndDelete (NewNumOperands, WalkState);
|
||||
+
|
||||
+ /* Restore operand count */
|
||||
+ WalkState->NumOperands = PrevNumOperands;
|
||||
|
||||
ACPI_EXCEPTION ((AE_INFO, Status, "While creating Arg %u", Index));
|
||||
return_ACPI_STATUS (Status);
|
||||
216
cve-2017-13694.patch
Normal file
216
cve-2017-13694.patch
Normal file
@ -0,0 +1,216 @@
|
||||
From 4a0243ecb4c94e2d73510d096c5ea4d0711fc6c0 Mon Sep 17 00:00:00 2001
|
||||
From: Seunghun Han <kkamagui@gmail.com>
|
||||
Date: Fri, 23 Jun 2017 14:19:48 +0900
|
||||
Subject: [PATCH] acpi: acpica: fix acpi parse and parseext cache leaks
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
I'm Seunghun Han, and I work for National Security Research Institute of
|
||||
South Korea.
|
||||
|
||||
I have been doing a research on ACPI and found an ACPI cache leak in ACPI
|
||||
early abort cases.
|
||||
|
||||
Boot log of ACPI cache leak is as follows:
|
||||
[ 0.352414] ACPI: Added _OSI(Module Device)
|
||||
[ 0.353182] ACPI: Added _OSI(Processor Device)
|
||||
[ 0.353182] ACPI: Added _OSI(3.0 _SCP Extensions)
|
||||
[ 0.353182] ACPI: Added _OSI(Processor Aggregator Device)
|
||||
[ 0.356028] ACPI: Unable to start the ACPI Interpreter
|
||||
[ 0.356799] ACPI Error: Could not remove SCI handler (20170303/evmisc-281)
|
||||
[ 0.360215] kmem_cache_destroy Acpi-State: Slab cache still has objects
|
||||
[ 0.360648] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W
|
||||
4.12.0-rc4-next-20170608+ #10
|
||||
[ 0.361273] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS
|
||||
VirtualBox 12/01/2006
|
||||
[ 0.361873] Call Trace:
|
||||
[ 0.362243] ? dump_stack+0x5c/0x81
|
||||
[ 0.362591] ? kmem_cache_destroy+0x1aa/0x1c0
|
||||
[ 0.362944] ? acpi_sleep_proc_init+0x27/0x27
|
||||
[ 0.363296] ? acpi_os_delete_cache+0xa/0x10
|
||||
[ 0.363646] ? acpi_ut_delete_caches+0x6d/0x7b
|
||||
[ 0.364000] ? acpi_terminate+0xa/0x14
|
||||
[ 0.364000] ? acpi_init+0x2af/0x34f
|
||||
[ 0.364000] ? __class_create+0x4c/0x80
|
||||
[ 0.364000] ? video_setup+0x7f/0x7f
|
||||
[ 0.364000] ? acpi_sleep_proc_init+0x27/0x27
|
||||
[ 0.364000] ? do_one_initcall+0x4e/0x1a0
|
||||
[ 0.364000] ? kernel_init_freeable+0x189/0x20a
|
||||
[ 0.364000] ? rest_init+0xc0/0xc0
|
||||
[ 0.364000] ? kernel_init+0xa/0x100
|
||||
[ 0.364000] ? ret_from_fork+0x25/0x30
|
||||
|
||||
I analyzed this memory leak in detail. I found that “Acpi-State” cache and
|
||||
“Acpi-Parse” cache were merged because the size of cache objects was same
|
||||
slab cache size.
|
||||
|
||||
I finally found “Acpi-Parse” cache and “Acpi-ParseExt” cache were leaked
|
||||
using SLAB_NEVER_MERGE flag in kmem_cache_create() function.
|
||||
|
||||
Real ACPI cache leak point is as follows:
|
||||
[ 0.360101] ACPI: Added _OSI(Module Device)
|
||||
[ 0.360101] ACPI: Added _OSI(Processor Device)
|
||||
[ 0.360101] ACPI: Added _OSI(3.0 _SCP Extensions)
|
||||
[ 0.361043] ACPI: Added _OSI(Processor Aggregator Device)
|
||||
[ 0.364016] ACPI: Unable to start the ACPI Interpreter
|
||||
[ 0.365061] ACPI Error: Could not remove SCI handler (20170303/evmisc-281)
|
||||
[ 0.368174] kmem_cache_destroy Acpi-Parse: Slab cache still has objects
|
||||
[ 0.369332] CPU: 1 PID: 1 Comm: swapper/0 Tainted: G W
|
||||
4.12.0-rc4-next-20170608+ #8
|
||||
[ 0.371256] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS
|
||||
VirtualBox 12/01/2006
|
||||
[ 0.372000] Call Trace:
|
||||
[ 0.372000] ? dump_stack+0x5c/0x81
|
||||
[ 0.372000] ? kmem_cache_destroy+0x1aa/0x1c0
|
||||
[ 0.372000] ? acpi_sleep_proc_init+0x27/0x27
|
||||
[ 0.372000] ? acpi_os_delete_cache+0xa/0x10
|
||||
[ 0.372000] ? acpi_ut_delete_caches+0x56/0x7b
|
||||
[ 0.372000] ? acpi_terminate+0xa/0x14
|
||||
[ 0.372000] ? acpi_init+0x2af/0x34f
|
||||
[ 0.372000] ? __class_create+0x4c/0x80
|
||||
[ 0.372000] ? video_setup+0x7f/0x7f
|
||||
[ 0.372000] ? acpi_sleep_proc_init+0x27/0x27
|
||||
[ 0.372000] ? do_one_initcall+0x4e/0x1a0
|
||||
[ 0.372000] ? kernel_init_freeable+0x189/0x20a
|
||||
[ 0.372000] ? rest_init+0xc0/0xc0
|
||||
[ 0.372000] ? kernel_init+0xa/0x100
|
||||
[ 0.372000] ? ret_from_fork+0x25/0x30
|
||||
[ 0.388039] kmem_cache_destroy Acpi-ParseExt: Slab cache still has objects
|
||||
[ 0.389063] CPU: 1 PID: 1 Comm: swapper/0 Tainted: G W
|
||||
4.12.0-rc4-next-20170608+ #8
|
||||
[ 0.390557] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS
|
||||
VirtualBox 12/01/2006
|
||||
[ 0.392000] Call Trace:
|
||||
[ 0.392000] ? dump_stack+0x5c/0x81
|
||||
[ 0.392000] ? kmem_cache_destroy+0x1aa/0x1c0
|
||||
[ 0.392000] ? acpi_sleep_proc_init+0x27/0x27
|
||||
[ 0.392000] ? acpi_os_delete_cache+0xa/0x10
|
||||
[ 0.392000] ? acpi_ut_delete_caches+0x6d/0x7b
|
||||
[ 0.392000] ? acpi_terminate+0xa/0x14
|
||||
[ 0.392000] ? acpi_init+0x2af/0x34f
|
||||
[ 0.392000] ? __class_create+0x4c/0x80
|
||||
[ 0.392000] ? video_setup+0x7f/0x7f
|
||||
[ 0.392000] ? acpi_sleep_proc_init+0x27/0x27
|
||||
[ 0.392000] ? do_one_initcall+0x4e/0x1a0
|
||||
[ 0.392000] ? kernel_init_freeable+0x189/0x20a
|
||||
[ 0.392000] ? rest_init+0xc0/0xc0
|
||||
[ 0.392000] ? kernel_init+0xa/0x100
|
||||
[ 0.392000] ? ret_from_fork+0x25/0x30
|
||||
|
||||
When early abort is occurred due to invalid ACPI information, Linux kernel
|
||||
terminates ACPI by calling acpi_terminate() function. The function calls
|
||||
acpi_ut_delete_caches() function to delete local caches (acpi_gbl_namespace_
|
||||
cache, state_cache, operand_cache, ps_node_cache, ps_node_ext_cache).
|
||||
|
||||
But the deletion codes in acpi_ut_delete_caches() function only delete
|
||||
slab caches using kmem_cache_destroy() function, therefore the cache
|
||||
objects should be flushed before acpi_ut_delete_caches() function.
|
||||
|
||||
“Acpi-Parse” cache and “Acpi-ParseExt” cache are used in an AML parse
|
||||
function, acpi_ps_parse_loop(). The function should have flush codes to
|
||||
handle an error state due to invalid AML codes.
|
||||
|
||||
This cache leak has a security threat because an old kernel (<= 4.9) shows
|
||||
memory locations of kernel functions in stack dump. Some malicious users
|
||||
could use this information to neutralize kernel ASLR.
|
||||
|
||||
To fix ACPI cache leak for enhancing security, I made a patch which has
|
||||
flush codes in acpi_ps_parse_loop() function.
|
||||
|
||||
I hope that this patch improves the security of Linux kernel.
|
||||
|
||||
Thank you.
|
||||
|
||||
Signed-off-by: Seunghun Han <kkamagui@gmail.com>
|
||||
|
||||
Github-Location: https://github.com/acpica/acpica/pull/278/commits/4a0243ecb4c94e2d73510d096c5ea4d0711fc6c0
|
||||
|
||||
---
|
||||
source/components/parser/psobject.c | 44 ++++++++++++++-----------------------
|
||||
1 file changed, 16 insertions(+), 28 deletions(-)
|
||||
|
||||
Index: acpica-unix2-20180531/source/components/parser/psobject.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20180531.orig/source/components/parser/psobject.c
|
||||
+++ acpica-unix2-20180531/source/components/parser/psobject.c
|
||||
@@ -709,7 +709,8 @@ AcpiPsCompleteFinalOp (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
ACPI_STATUS Status)
|
||||
{
|
||||
- ACPI_STATUS Status2;
|
||||
+ ACPI_STATUS ReturnStatus = AE_OK;
|
||||
+ BOOLEAN Ascending = TRUE;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR (PsCompleteFinalOp, WalkState);
|
||||
@@ -726,7 +727,7 @@ AcpiPsCompleteFinalOp (
|
||||
{
|
||||
if (Op)
|
||||
{
|
||||
- if (WalkState->AscendingCallback != NULL)
|
||||
+ if (Ascending && WalkState->AscendingCallback != NULL)
|
||||
{
|
||||
WalkState->Op = Op;
|
||||
WalkState->OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
|
||||
@@ -745,41 +746,28 @@ AcpiPsCompleteFinalOp (
|
||||
|
||||
if (Status == AE_CTRL_TERMINATE)
|
||||
{
|
||||
- Status = AE_OK;
|
||||
-
|
||||
- /* Clean up */
|
||||
- do
|
||||
- {
|
||||
- if (Op)
|
||||
- {
|
||||
- Status2 = AcpiPsCompleteThisOp (WalkState, Op);
|
||||
- if (ACPI_FAILURE (Status2))
|
||||
- {
|
||||
- return_ACPI_STATUS (Status2);
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- AcpiPsPopScope (&(WalkState->ParserState), &Op,
|
||||
- &WalkState->ArgTypes, &WalkState->ArgCount);
|
||||
-
|
||||
- } while (Op);
|
||||
-
|
||||
- return_ACPI_STATUS (Status);
|
||||
+ Ascending = FALSE;
|
||||
+ ReturnStatus = AE_CTRL_TERMINATE;
|
||||
}
|
||||
|
||||
else if (ACPI_FAILURE (Status))
|
||||
{
|
||||
/* First error is most important */
|
||||
|
||||
- (void) AcpiPsCompleteThisOp (WalkState, Op);
|
||||
- return_ACPI_STATUS (Status);
|
||||
+ Ascending = FALSE;
|
||||
+ ReturnStatus = Status;
|
||||
}
|
||||
}
|
||||
|
||||
- Status2 = AcpiPsCompleteThisOp (WalkState, Op);
|
||||
- if (ACPI_FAILURE (Status2))
|
||||
+ Status = AcpiPsCompleteThisOp (WalkState, Op);
|
||||
+ if (ACPI_FAILURE (Status))
|
||||
{
|
||||
- return_ACPI_STATUS (Status2);
|
||||
+ Ascending = FALSE;
|
||||
+ if (ACPI_SUCCESS (ReturnStatus) ||
|
||||
+ ReturnStatus == AE_CTRL_TERMINATE)
|
||||
+ {
|
||||
+ ReturnStatus = Status;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -788,5 +776,5 @@ AcpiPsCompleteFinalOp (
|
||||
|
||||
} while (Op);
|
||||
|
||||
- return_ACPI_STATUS (Status);
|
||||
+ return_ACPI_STATUS (ReturnStatus);
|
||||
}
|
||||
90
cve-2017-13695.patch
Normal file
90
cve-2017-13695.patch
Normal file
@ -0,0 +1,90 @@
|
||||
From 37f2c716f2c6ab14c3ba557a539c3ee3224931b5 Mon Sep 17 00:00:00 2001
|
||||
From: Seunghun Han <kkamagui@gmail.com>
|
||||
Date: Wed, 19 Jul 2017 17:04:44 +0900
|
||||
Subject: [PATCH] acpi: acpica: fix acpi operand cache leak in nseval.c
|
||||
|
||||
I found an ACPI cache leak in ACPI early termination and boot continuing case.
|
||||
|
||||
When early termination occurs due to malicious ACPI table, Linux kernel
|
||||
terminates ACPI function and continues to boot process. While kernel terminates
|
||||
ACPI function, kmem_cache_destroy() reports Acpi-Operand cache leak.
|
||||
|
||||
Boot log of ACPI operand cache leak is as follows:
|
||||
>[ 0.464168] ACPI: Added _OSI(Module Device)
|
||||
>[ 0.467022] ACPI: Added _OSI(Processor Device)
|
||||
>[ 0.469376] ACPI: Added _OSI(3.0 _SCP Extensions)
|
||||
>[ 0.471647] ACPI: Added _OSI(Processor Aggregator Device)
|
||||
>[ 0.477997] ACPI Error: Null stack entry at ffff880215c0aad8 (20170303/exresop-174)
|
||||
>[ 0.482706] ACPI Exception: AE_AML_INTERNAL, While resolving operands for [OpcodeName unavailable] (20170303/dswexec-461)
|
||||
>[ 0.487503] ACPI Error: Method parse/execution failed [\DBG] (Node ffff88021710ab40), AE_AML_INTERNAL (20170303/psparse-543)
|
||||
>[ 0.492136] ACPI Error: Method parse/execution failed [\_SB._INI] (Node ffff88021710a618), AE_AML_INTERNAL (20170303/psparse-543)
|
||||
>[ 0.497683] ACPI: Interpreter enabled
|
||||
>[ 0.499385] ACPI: (supports S0)
|
||||
>[ 0.501151] ACPI: Using IOAPIC for interrupt routing
|
||||
>[ 0.503342] ACPI Error: Null stack entry at ffff880215c0aad8 (20170303/exresop-174)
|
||||
>[ 0.506522] ACPI Exception: AE_AML_INTERNAL, While resolving operands for [OpcodeName unavailable] (20170303/dswexec-461)
|
||||
>[ 0.510463] ACPI Error: Method parse/execution failed [\DBG] (Node ffff88021710ab40), AE_AML_INTERNAL (20170303/psparse-543)
|
||||
>[ 0.514477] ACPI Error: Method parse/execution failed [\_PIC] (Node ffff88021710ab18), AE_AML_INTERNAL (20170303/psparse-543)
|
||||
>[ 0.518867] ACPI Exception: AE_AML_INTERNAL, Evaluating _PIC (20170303/bus-991)
|
||||
>[ 0.522384] kmem_cache_destroy Acpi-Operand: Slab cache still has objects
|
||||
>[ 0.524597] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.12.0-rc5 #26
|
||||
>[ 0.526795] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006
|
||||
>[ 0.529668] Call Trace:
|
||||
>[ 0.530811] ? dump_stack+0x5c/0x81
|
||||
>[ 0.532240] ? kmem_cache_destroy+0x1aa/0x1c0
|
||||
>[ 0.533905] ? acpi_os_delete_cache+0xa/0x10
|
||||
>[ 0.535497] ? acpi_ut_delete_caches+0x3f/0x7b
|
||||
>[ 0.537237] ? acpi_terminate+0xa/0x14
|
||||
>[ 0.538701] ? acpi_init+0x2af/0x34f
|
||||
>[ 0.540008] ? acpi_sleep_proc_init+0x27/0x27
|
||||
>[ 0.541593] ? do_one_initcall+0x4e/0x1a0
|
||||
>[ 0.543008] ? kernel_init_freeable+0x19e/0x21f
|
||||
>[ 0.546202] ? rest_init+0x80/0x80
|
||||
>[ 0.547513] ? kernel_init+0xa/0x100
|
||||
>[ 0.548817] ? ret_from_fork+0x25/0x30
|
||||
>[ 0.550587] vgaarb: loaded
|
||||
>[ 0.551716] EDAC MC: Ver: 3.0.0
|
||||
>[ 0.553744] PCI: Probing PCI hardware
|
||||
>[ 0.555038] PCI host bridge to bus 0000:00
|
||||
> ... Continue to boot and log is omitted ...
|
||||
|
||||
I analyzed this memory leak in detail and found AcpiNsEvaluate() function
|
||||
only removes Info->ReturnObject in AE_CTRL_RETURN_VALUE case. But, when errors
|
||||
occur, the status value is not AE_CTRL_RETURN_VALUE, and Info->ReturnObject is
|
||||
also not null. Therefore, this causes acpi operand memory leak.
|
||||
|
||||
This cache leak causes a security threat because an old kernel (<= 4.9) shows
|
||||
memory locations of kernel functions in stack dump. Some malicious users
|
||||
could use this information to neutralize kernel ASLR.
|
||||
|
||||
I made a patch to fix ACPI operand cache leak.
|
||||
|
||||
Signed-off-by: Seunghun Han <kkamagui@gmail.com>
|
||||
|
||||
Github-Location: https://github.com/acpica/acpica/pull/296/commits/37f2c716f2c6ab14c3ba557a539c3ee3224931b5
|
||||
|
||||
---
|
||||
source/components/namespace/nseval.c | 10 ++++++++++
|
||||
1 file changed, 10 insertions(+)
|
||||
|
||||
Index: acpica-unix2-20181213/source/components/namespace/nseval.c
|
||||
===================================================================
|
||||
--- acpica-unix2-20181213.orig/source/components/namespace/nseval.c
|
||||
+++ acpica-unix2-20181213/source/components/namespace/nseval.c
|
||||
@@ -336,6 +336,16 @@ AcpiNsEvaluate (
|
||||
Info->ReturnObject = NULL;
|
||||
}
|
||||
}
|
||||
+ else if (ACPI_FAILURE(Status))
|
||||
+ {
|
||||
+ /* If ReturnObject exists, delete it */
|
||||
+
|
||||
+ if (Info->ReturnObject)
|
||||
+ {
|
||||
+ AcpiUtRemoveReference (Info->ReturnObject);
|
||||
+ Info->ReturnObject = NULL;
|
||||
+ }
|
||||
+ }
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
|
||||
"*** Completed evaluation of object %s ***\n",
|
||||
59
openEuler-harden.patch
Normal file
59
openEuler-harden.patch
Normal file
@ -0,0 +1,59 @@
|
||||
diff -Naur a/generate/unix/iasl/Makefile b/generate/unix/iasl/Makefile
|
||||
--- a/generate/unix/iasl/Makefile 2020-07-23 06:45:14.064000000 +0000
|
||||
+++ b/generate/unix/iasl/Makefile 2020-07-23 06:57:32.080000000 +0000
|
||||
@@ -358,34 +358,35 @@
|
||||
# Cannot use the common compile warning flags since the C files are created
|
||||
# by the utilities above and they are not necessarily ANSI C, etc.
|
||||
#
|
||||
+HARDENING_FLAGS = -fPIC -pie
|
||||
$(OBJDIR)/aslcompilerlex.o : $(OBJDIR)/aslcompilerlex.c
|
||||
@echo "- " "Intermediate" $<
|
||||
- @$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
|
||||
+ @$(CC) -c $(CFLAGS) $(HARDENING_FLAGS) -Wall -Werror -o$@ $<
|
||||
|
||||
$(OBJDIR)/aslcompilerparse.o : $(OBJDIR)/aslcompilerparse.c
|
||||
@echo "- " "Intermediate" $<
|
||||
- @$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
|
||||
+ @$(CC) -c $(CFLAGS) $(HARDENING_FLAGS) -Wall -Werror -o$@ $<
|
||||
|
||||
$(OBJDIR)/dtcompilerparserlex.o : $(OBJDIR)/dtcompilerparserlex.c
|
||||
@echo "- " "Intermediate" $<
|
||||
- @$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
|
||||
+ @$(CC) -c $(CFLAGS) $(HARDENING_FLAGS) -Wall -Werror -o$@ $<
|
||||
|
||||
$(OBJDIR)/dtcompilerparserparse.o : $(OBJDIR)/dtcompilerparserparse.c
|
||||
@echo "- " "Intermediate" $<
|
||||
- @$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
|
||||
+ @$(CC) -c $(CFLAGS) $(HARDENING_FLAGS) -Wall -Werror -o$@ $<
|
||||
|
||||
$(OBJDIR)/dtparserlex.o : $(OBJDIR)/dtparserlex.c
|
||||
@echo "- " "Intermediate" $<
|
||||
- @$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
|
||||
+ @$(CC) -c $(CFLAGS) $(HARDENING_FLAGS) -Wall -Werror -o$@ $<
|
||||
|
||||
$(OBJDIR)/dtparserparse.o : $(OBJDIR)/dtparserparse.c
|
||||
@echo "- " "Intermediate" $<
|
||||
- @$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
|
||||
+ @$(CC) -c $(CFLAGS) $(HARDENING_FLAGS) -Wall -Werror -o$@ $<
|
||||
|
||||
$(OBJDIR)/prparserlex.o : $(OBJDIR)/prparserlex.c
|
||||
@echo "- " "Intermediate" $<
|
||||
- @$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
|
||||
+ @$(CC) -c $(CFLAGS) $(HARDENING_FLAGS) -Wall -Werror -o$@ $<
|
||||
|
||||
$(OBJDIR)/prparserparse.o : $(OBJDIR)/prparserparse.c
|
||||
@echo "- " "Intermediate" $<
|
||||
- @$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
|
||||
+ @$(CC) -c $(CFLAGS) $(HARDENING_FLAGS) -Wall -Werror -o$@ $<
|
||||
diff -Naur a/generate/unix/Makefile.config b/generate/unix/Makefile.config
|
||||
--- a/generate/unix/Makefile.config 2020-07-23 06:45:14.065000000 +0000
|
||||
+++ b/generate/unix/Makefile.config 2020-07-23 06:47:00.436000000 +0000
|
||||
@@ -181,6 +181,8 @@
|
||||
OPT_CFLAGS += -D_FORTIFY_SOURCE=2
|
||||
endif
|
||||
|
||||
+OPT_CFLAGS += -fPIC -pie
|
||||
+
|
||||
CFLAGS += \
|
||||
-D$(ACPI_HOST)\
|
||||
-D_GNU_SOURCE\
|
||||
Loading…
x
Reference in New Issue
Block a user