Subject: [alpine-aports] [PATCH] main/linux-grsec: enable hibernation for x86_64

From: Andrew Hills <[email-masked]>
Date: Mon, 29 Jun 2015 14:59:37 +0000

New patch reverts grsec patch which disabled hibernation (thanks
to stf on IRC).
---
 main/linux-grsec/APKBUILD                | 18 +++++++++++-------
 main/linux-grsec/config-grsec.x86_64     |  3 +++
 main/linux-grsec/config-virtgrsec.x86_64 |  5 ++++-
 main/linux-grsec/hibernate.patch         | 11 +++++++++++
 4 files changed, 29 insertions(+), 8 deletions(-)
 create mode 100644 main/linux-grsec/hibernate.patch

diff --git a/main/linux-grsec/APKBUILD b/main/linux-grsec/APKBUILD
index e6d8acd..ab51507 100644
--- a/main/linux-grsec/APKBUILD
+++ b/main/linux-grsec/APKBUILD
@@ -7,7 +7,7 @@ case $pkgver in
 *.*.*)	_kernver=${pkgver%.*};;
 *.*)	_kernver=${pkgver};;
 esac
-pkgrel=0
+pkgrel=1
 pkgdesc="Linux kernel with grsecurity"
 url=http://grsecurity.net
 depends="mkinitfs linux-firmware"
@@ -22,6 +22,7 @@ source="http://ftp.kernel.org/pub/linux/kernel/v3.x/linux-$_kernver.tar.xz
 	fix-memory-map-for-PIE-applications.patch
 	fix-spi-nor-namespace-clash.patch
 	imx6q-no-unclocked-sleep.patch
+	hibernate.patch
 
 	config-grsec.x86
 	config-grsec.x86_64
@@ -205,30 +206,33 @@ dee848728d351ead91cdc59254175775  grsecurity-3.1-3.18.16-201506082249-alpine.pat
 c6a4ae7e8ca6159e1631545515805216  fix-memory-map-for-PIE-applications.patch
 b0337a2a9abed17c37eae5db332522d2  fix-spi-nor-namespace-clash.patch
 1a307fc1d63231bf01d22493a4f14378  imx6q-no-unclocked-sleep.patch
+5bffe7379e1ac95407346c0639bcf2d2  hibernate.patch
 797644a9dda4436978498045ef7095b1  config-grsec.x86
-9476dc4a1d21009764680816fde71152  config-grsec.x86_64
+a33ea6acdfe8fbc5b2ec61980505ac82  config-grsec.x86_64
 6af88f5e681a237e3c58e8154a40fb47  config-grsec.armhf
 18cb4521f9a8847637292f9f4c9e8256  config-virtgrsec.x86
-80b45900be93b1183a6382adf710d961  config-virtgrsec.x86_64"
+192f6042aa5bb6290e2e3e14e1b477e8  config-virtgrsec.x86_64"
 sha256sums="becc413cc9e6d7f5cc52a3ce66d65c3725bc1d1cc1001f4ce6c32b69eb188cbd  linux-3.18.tar.xz
 f60602c8de2ae7b1507c538b6af65d5b933727a06f56075898ff64fdcf650313  patch-3.18.16.xz
 920b9f5dd1659656319e45c803f4b28c91d0bfa9a4a51300bdd5f85b3096d4c6  grsecurity-3.1-3.18.16-201506082249-alpine.patch
 500f3577310be52e87b9fecdc2e9c4ca43210fd97d69089f9005d484563f74c7  fix-memory-map-for-PIE-applications.patch
 01279cfb93273d99670c56e2465957ecde3d03693beeb929a743f03afa0b7bdc  fix-spi-nor-namespace-clash.patch
 21179fbb22a5b74af0a609350ae1a170e232908572b201d02e791d2ce0a685d3  imx6q-no-unclocked-sleep.patch
+836f913f77d19a7e08f57e11430dbdea67b118f6e758cfe720745d066e915fce  hibernate.patch
 096425842c0c84c063fff14108630f49d32f64e970027e0f2050ce76558c05db  config-grsec.x86
-18cc34f2d603baf82af7093daaf024d74047506154e53de27fb49ba65a2551d1  config-grsec.x86_64
+ea8ea798acad4ff7779eb3fbbad901db2e700467d446f91f3adb1467e6eb8cf8  config-grsec.x86_64
 c796c15a32c848cfd6b67c2f22273fb3e26872f9325a6564f316b17b947eeaaf  config-grsec.armhf
 47048993111506ab74db24c92d39b536cf5e684975844907d5cb6198c1dfd87f  config-virtgrsec.x86
-015ce51a03f1337673b47ef996b77c55cf50a28240e37c5ebf7e66f5886d3aef  config-virtgrsec.x86_64"
+50ec125cace82d07e1d6f700c4b5fe46e19ed6210c22368f73e206d778e96fd8  config-virtgrsec.x86_64"
 sha512sums="2f0b72466e9bc538a675738aa416573d41bbbd7e3e2ffd5b5b127afde609ebc278cec5a3c37e73479607e957c13f1b4ed9782a3795e0dcc2cf8e550228594009  linux-3.18.tar.xz
 868de9793e67e741dc69d61339f66c25d08d36a7d67b09d5644e855e05faf239c1e6e01299812a68edc52a39e132d7ec459929cb5d8a0936fe6aa580a72af80c  patch-3.18.16.xz
 9d423b6edb1a758d3832349c47b4ed70394dac0665e30f1f254e3fa200a9db02a93728faf68d7908f5dd825a94c3dd017b9296d6a4ee90d9f14691338c5163f7  grsecurity-3.1-3.18.16-201506082249-alpine.patch
 4665c56ae1bbac311f9205d64918e84ee8b01d47d6e2396ff6b8adfb10aada7f7254531ce62e31edbb65c2a54a830f09ad05d314dfcd75d6272f4068945ad7c7  fix-memory-map-for-PIE-applications.patch
 4e3aeb70712f9838afea75fe9e6c1389414d833a89286ea55441d6a8d54ce74b0e39b565721e3153443af0a614bff57c767251b7e5b81faa5e0784eddfcd2164  fix-spi-nor-namespace-clash.patch
 87d1ad59732f265a5b0db54490dc1762c14ea4b868e7eb1aedc3ce57b48046de7bbc08cf5cfcf6f1380fa84063b0edb16ba3d5e3c5670be9bbb229275c88b221  imx6q-no-unclocked-sleep.patch
+5fbdcf3d97028ef9808b51d084ef0321a75a8bd4129d0aeea14235262a27de198f97f1a5ad75d1e5fb878dda12165c26fa631953ae8563ca916ddb5488f3b247  hibernate.patch
 ee88d6b3984a97f18d721d49ae76b302a80d4c0f8779d580199d35869358423e22895b1245725d345b6c99714844444ab9c433281f129347e4d5510336ca9cff  config-grsec.x86
-20ba11b7b2d874a354aa4c364cac6885863deddd4c166ad98e0d5dcb24d102b0e3875eef60a252e1bedb1526fd25e11721c78e6ca50baf5fc4a9ec58e1c3b1a2  config-grsec.x86_64
+840663c91f68cc2de22f9cca9e065873986e0c539de68df8e2124ea6627dd5d1dc13af5dd7ebeb37587595e6cd62c278837d6a4001f8f0acfbc7d589f5e26423  config-grsec.x86_64
 a54a297c3e0700242b1745d5377fa16585bec0b2d9e94b0bf3a4afee04a193413441e850e1233664d2692833245f7994ce5166fe99513d9a8247c9cdf9f87200  config-grsec.armhf
 c6bebe64953a444bc7d13f932e44d081665c253121189a3ccca9d7f6145b4460e32dc0f21f4700bf6607c5c0cb79de5c8576e4da0c815d60cff0d3b90879c1d9  config-virtgrsec.x86
-47f93ae57dc923efe81132b00a8c0a5f4aa029a5f64e411110b1ef99dc018f9d7d8af1632ea7ea42693e847388484b149f666db7dd7f423b5b1ad3baed83d75f  config-virtgrsec.x86_64"
+0cc69b0d1ce57ba2dd4372fc19e45a427e3ea87225b05d4e5392deb21080d15b5ac397f71e3e20b1516312ddcfea819010715610cf855e3ffe311f76ecceb2bb  config-virtgrsec.x86_64"
diff --git a/main/linux-grsec/config-grsec.x86_64 b/main/linux-grsec/config-grsec.x86_64
index 7b6d4ed..d39d819 100644
--- a/main/linux-grsec/config-grsec.x86_64
+++ b/main/linux-grsec/config-grsec.x86_64
@@ -515,9 +515,12 @@ CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
 #
 # Power management and ACPI options
 #
+CONFIG_ARCH_HIBERNATION_HEADER=y
 CONFIG_SUSPEND=y
 CONFIG_SUSPEND_FREEZER=y
 CONFIG_HIBERNATE_CALLBACKS=y
+CONFIG_HIBERNATION=y
+CONFIG_PM_STD_PARTITION=""
 CONFIG_PM_SLEEP=y
 CONFIG_PM_SLEEP_SMP=y
 # CONFIG_PM_AUTOSLEEP is not set
diff --git a/main/linux-grsec/config-virtgrsec.x86_64 b/main/linux-grsec/config-virtgrsec.x86_64
index be0282a..fa5db39 100644
--- a/main/linux-grsec/config-virtgrsec.x86_64
+++ b/main/linux-grsec/config-virtgrsec.x86_64
@@ -1,6 +1,6 @@
 #
 # Automatically generated file; DO NOT EDIT.
-# Linux/x86 3.18.14 Kernel Configuration
+# Linux/x86 3.18.16 Kernel Configuration
 #
 CONFIG_64BIT=y
 CONFIG_X86_64=y
@@ -489,9 +489,12 @@ CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
 #
 # Power management and ACPI options
 #
+CONFIG_ARCH_HIBERNATION_HEADER=y
 CONFIG_SUSPEND=y
 CONFIG_SUSPEND_FREEZER=y
 CONFIG_HIBERNATE_CALLBACKS=y
+CONFIG_HIBERNATION=y
+CONFIG_PM_STD_PARTITION=""
 CONFIG_PM_SLEEP=y
 CONFIG_PM_SLEEP_SMP=y
 # CONFIG_PM_AUTOSLEEP is not set
diff --git a/main/linux-grsec/hibernate.patch b/main/linux-grsec/hibernate.patch
new file mode 100644
index 0000000..0f41c07
--- /dev/null
+++ b/main/linux-grsec/hibernate.patch
@@ -0,0 +1,11 @@
+--- a/kernel/power/Kconfig
++++ b/kernel/power/Kconfig
+@@ -24,8 +24,6 @@ config HIBERNATE_CALLBACKS
+ config HIBERNATION
+ 	bool "Hibernation (aka 'suspend to disk')"
+ 	depends on SWAP && ARCH_HIBERNATION_POSSIBLE
+-	depends on !GRKERNSEC_KMEM
+-	depends on !PAX_MEMORY_SANITIZE
+ 	select HIBERNATE_CALLBACKS
+ 	select LZO_COMPRESS
+ 	select LZO_DECOMPRESS
-- 
2.4.2

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---