summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ACPICA-AML-Parser-ignore-control-method-status-in-module-level-code.patch53
-rw-r--r--PKGBUILD64
2 files changed, 73 insertions, 44 deletions
diff --git a/ACPICA-AML-Parser-ignore-control-method-status-in-module-level-code.patch b/ACPICA-AML-Parser-ignore-control-method-status-in-module-level-code.patch
new file mode 100644
index 0000000..c692990
--- /dev/null
+++ b/ACPICA-AML-Parser-ignore-control-method-status-in-module-level-code.patch
@@ -0,0 +1,53 @@
+From f51d7e02375963169fb1c1148ac3f96d54e97ec4 Mon Sep 17 00:00:00 2001
+From: Erik Schmauss <erik.schmauss@intel.com>
+Date: Sat, 28 Jul 2018 14:49:55 +0200
+Subject: [PATCH] ACPICA: AML Parser: ignore control method status in
+ module-level code
+
+Previous change in the AML parser code blindly set all non-successful
+dispatcher statuses to AE_OK. This approach is incorrect because
+successful control method invocations from module-level return
+AE_CTRL_TRANSFER. Overwriting AE_OK to this status causes the AML
+parser to think that there was no return value from the control
+method invocation.
+
+fixes: 73c2a01c52b6 (ACPICA: AML Parser: ignore dispatcher error status during table load)
+
+Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
+---
+ drivers/acpi/acpica/psloop.c | 19 ++++++++++++-------
+ 1 file changed, 12 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/acpi/acpica/psloop.c b/drivers/acpi/acpica/psloop.c
+index ee840be150b5e..44f35ab3347d1 100644
+--- a/drivers/acpi/acpica/psloop.c
++++ b/drivers/acpi/acpica/psloop.c
+@@ -709,15 +709,20 @@ acpi_status acpi_ps_parse_loop(struct acpi_walk_state *walk_state)
+ } else
+ if ((walk_state->
+ parse_flags & ACPI_PARSE_MODULE_LEVEL)
++ && status != AE_CTRL_TRANSFER
+ && ACPI_FAILURE(status)) {
+ /*
+- * ACPI_PARSE_MODULE_LEVEL means that we are loading a table by
+- * executing it as a control method. However, if we encounter
+- * an error while loading the table, we need to keep trying to
+- * load the table rather than aborting the table load. Set the
+- * status to AE_OK to proceed with the table load. If we get a
+- * failure at this point, it means that the dispatcher got an
+- * error while processing Op (most likely an AML operand error.
++ * ACPI_PARSE_MODULE_LEVEL flag means that we are currently
++ * loading a table by executing it as a control method.
++ * However, if we encounter an error while loading the table,
++ * we need to keep trying to load the table rather than
++ * aborting the table load (setting the status to AE_OK
++ * continues the table load). If we get a failure at this
++ * point, it means that the dispatcher got an error while
++ * processing Op (most likely an AML operand error) or a
++ * control method was called from module level and the
++ * dispatcher returned AE_CTRL_TRANSFER. In the latter case,
++ * leave the status alone, there's nothing wrong with it.
+ */
+ status = AE_OK;
+ }
diff --git a/PKGBUILD b/PKGBUILD
index 2230d38..47a8023 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -5,18 +5,16 @@
pkgbase=linux-hardened-ck
_majver=4.17
-_minver=10
-_fullver=${_majver}.${_minver}
-_basever=${_majver}
-_pkgver=${_fullver}
-_hardver=a
+_minver=11
+_pkgver=${_majver}.${_minver}
+_hardenedver=a
_NUMAdisable=y
_ckpatchversion=1
_ckpatchname="patch-${_majver}-ck${_ckpatchversion}"
_jcpatchversion="jcmod1"
_gcc_more_v='20180509'
-_srcname=linux-${_majver}
-pkgver=${_fullver}.${_hardver}
+_srcname=linux-${_pkgver}
+pkgver=${_pkgver}.${_hardenedver}
pkgrel=1
conflicts=('linux-libre-hardened-ck')
url='https://github.com/anthraxx/linux-hardened'
@@ -25,11 +23,9 @@ arch=('x86_64')
license=('GPL2')
makedepends=('xmlto' 'kmod' 'inetutils' 'bc' 'libelf')
options=('!strip')
-source=(https://www.kernel.org/pub/linux/kernel/v4.x/${_srcname}.tar.xz
- https://www.kernel.org/pub/linux/kernel/v4.x/${_srcname}.tar.sign
- https://www.kernel.org/pub/linux/kernel/v4.x/patch-${_pkgver}.xz
- https://www.kernel.org/pub/linux/kernel/v4.x/patch-${_pkgver}.sign
- https://github.com/anthraxx/linux-hardened/releases/download/${_fullver}.${_hardver}/linux-hardened-${_fullver}.${_hardver}.patch{,.sig}
+source=(https://www.kernel.org/pub/linux/kernel/v4.x/linux-${_pkgver}.tar.xz
+ https://www.kernel.org/pub/linux/kernel/v4.x/linux-${_pkgver}.tar.sign
+ https://github.com/anthraxx/linux-hardened/releases/download/${_pkgver}.${_hardenedver}/linux-hardened-${_pkgver}.${_hardenedver}.patch{,.sig}
patch-${_majver}-ck${_ckpatchversion}-${_jcpatchversion}.patch
#http://ck.kolivas.org/patches/4.0/${_majver}/${_majver}-ck${_ckpatchversion}/${_ckpatchname}.xz
enable_additional_cpu_optimizations-$_gcc_more_v.tar.gz::https://github.com/graysky2/kernel_gcc_patch/archive/$_gcc_more_v.tar.gz
@@ -45,12 +41,11 @@ source=(https://www.kernel.org/pub/linux/kernel/v4.x/${_srcname}.tar.xz
Revert-drm-i915-edp-Allow-alternate-fixed-mode-for-e.patch
# Fix iwd provoking a BUG
mac80211-disable-BHs-preemption-in-ieee80211_tx_cont.patch
+ ACPICA-AML-Parser-ignore-control-method-status-in-module-level-code.patch
)
-sha256sums=('9faa1dd896eaea961dc6e886697c0b3301277102e5bc976b2758f9a62d3ccd13'
+sha256sums=('db1e84ed4f213b43d50f3373627b2ffcdb3b65f3430f746a38f801554ef3728c'
'SKIP'
- '41ad005296c7a1b5245a87881f666b3f4d7aa05a6b9409454b2e473d473c4cee'
- 'SKIP'
- '2da7c447a0d4b1969c220488e5eef2c85fa93861ad5909c632c26cbabbb256b3'
+ '586f3a84cf79cee5a7839941b6b434be519515c317abc8e6d491174652ac93cb'
'SKIP'
'27b96297102a9ccf690c1bdc5f21bc10308f6de90396385dce7341fb8e5a2116'
'226e30068ea0fecdb22f337391385701996bfbdba37cdcf0f1dbf55f1080542d'
@@ -61,7 +56,8 @@ sha256sums=('9faa1dd896eaea961dc6e886697c0b3301277102e5bc976b2758f9a62d3ccd13'
'ad6344badc91ad0630caacde83f7f9b97276f80d26a20619a87952be65492c65'
'd744e7f4552896670bc8b99361534eec7ba095bebc2462ef0e5ee433e6341a0a'
'8114295b8c07795a15b9f8eafb0f515c34661a1e05512da818a34581dd30f87e'
- 'ef7c149d9af24efea551cec86e26f52c9c1cc02714335e948f929985ff414676')
+ 'ef7c149d9af24efea551cec86e26f52c9c1cc02714335e948f929985ff414676'
+ '25a0c0de5bae21f30557ed32815759be147a6a33020dc289e913d3147d3244f3')
validpgpkeys=(
'ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linus Torvalds
'647F28654894E3BD457199BE38DBBDC86092693E' # Greg Kroah-Hartman
@@ -69,20 +65,17 @@ validpgpkeys=(
'E240B57E2C4630BA768E2F26FC1B547C8D8172C8' # Levente Polyak
)
_kernelname=${pkgbase#linux}
-: ${_kernelname:=-ARCH}
+: ${_kernelname:=-hardened}
prepare() {
cd ${_srcname}
- # add upstream patch
- msg2 "Applying upstream patch"
- patch -p1 -i "${srcdir}/patch-${_fullver}"
-
# Hotfixes
msg2 "Applying hotfixes"
patch -p1 -i "${srcdir}/ACPI-watchdog-Prefer-iTCO_wdt-always-when-WDAT-table.patch"
patch -p1 -i "${srcdir}/Revert-drm-i915-edp-Allow-alternate-fixed-mode-for-e.patch"
patch -p1 -i "${srcdir}/mac80211-disable-BHs-preemption-in-ieee80211_tx_cont.patch"
+ patch -p1 -i "${srcdir}/ACPICA-AML-Parser-ignore-control-method-status-in-module-level-code.patch"
# fix naming schema in EXTRAVERSION of ck patch set
#sed -i -re "s/^(.EXTRAVERSION).*$/\1 = /" "../${_ckpatchname}"
@@ -105,16 +98,13 @@ prepare() {
patch -p1 -i "${srcdir}/ath9k-regdom-hack.patch"
- # add latest fixes from stable queue, if needed
- # http://git.kernel.org/?p=linux/kernel/git/stable/stable-queue.git
-
cat ../config.x86_64 - >.config <<END
CONFIG_LOCALVERSION="${_kernelname}"
CONFIG_LOCALVERSION_AUTO=n
END
# set extraversion to pkgrel and empty localversion
- sed -e "/^EXTRAVERSION =/s/=.*/= -${pkgrel}/" \
+ sed -e "/^EXTRAVERSION =/s/=.*/= .${_hardenedver}-${pkgrel}/" \
-e "/^EXTRAVERSION =/aLOCALVERSION =" \
-i Makefile
@@ -134,27 +124,13 @@ END
-i -e '/CONFIG_ACPI_NUMA=y/d' ./.config
fi
- # don't run depmod on 'make install'. We'll do this ourselves in packaging
- sed -i '2iexit 0' scripts/depmod.sh
-
- # get kernel version
- make prepare
-
- # load configuration
- # Configure the kernel. Replace the line below with one of your choice.
- make menuconfig # CLI menu for configuration
- #make nconfig # new CLI menu for configuration
- #make xconfig # X-based configuration
- #make oldconfig # using old config from previous kernel version
- # ... or manually edit .config
-
- # rewrite configuration
- yes "" | make config >/dev/null
+ make olddefconfig
+
+ make menuconfig
}
build() {
cd ${_srcname}
-
make bzImage modules
}
@@ -175,7 +151,7 @@ _package() {
_basekernel=${_basekernel%.*}
mkdir -p "${pkgdir}"/{boot,usr/lib/modules}
- make INSTALL_MOD_PATH="${pkgdir}/usr" modules_install
+ make INSTALL_MOD_PATH="${pkgdir}/usr" DEPMOD=/doesnt/exist modules_install
cp arch/x86/boot/bzImage "${pkgdir}/boot/vmlinuz-${pkgbase}"
# make room for external modules