From 962ea4f047b3b4b4360446be4289c4e4deb29551 Mon Sep 17 00:00:00 2001 From: "Justin M. Forbes" Date: Wed, 14 Dec 2016 12:50:48 -0600 Subject: [PATCH] Linux v4.9-7150-gcdb98c2 --- ACPI-Limit-access-to-custom_method.patch | 31 - Add-EFI-signature-data-types.patch | 2 +- Add-secure_modules-call.patch | 63 - ...q-option-to-disable-secure-boot-mode.patch | 246 -- ...R-access-when-module-security-is-ena.patch | 118 - ...-and-dev-kmem-when-module-loading-is.patch | 42 - ..._rsdp-kernel-parameter-when-module-l.patch | 39 - arm64-ACPI-parse-SPCR-table.patch | 101 - ...t-debugfs-interface-when-module-load.patch | 54 - baseconfig/CONFIG_ABP060MG | 1 + baseconfig/CONFIG_AD7766 | 1 + baseconfig/CONFIG_ARM64_SW_TTBR0_PAN | 1 + baseconfig/CONFIG_BCM2835_VCHIQ | 1 + baseconfig/CONFIG_BLK_DEV_ZONED | 1 + baseconfig/CONFIG_BLK_WBT | 1 + baseconfig/CONFIG_BLK_WBT_MQ | 1 + baseconfig/CONFIG_BLK_WBT_SQ | 1 + baseconfig/CONFIG_COMMON_CLK_HI3516CV300 | 1 + baseconfig/CONFIG_COMMON_CLK_HI3798CV200 | 1 + baseconfig/CONFIG_COMMON_CLK_MT2701 | 1 + baseconfig/CONFIG_COMMON_CLK_MT2701_BDPSYS | 1 + baseconfig/CONFIG_COMMON_CLK_MT2701_ETHSYS | 1 + baseconfig/CONFIG_COMMON_CLK_MT2701_HIFSYS | 1 + baseconfig/CONFIG_COMMON_CLK_MT2701_IMGSYS | 1 + baseconfig/CONFIG_COMMON_CLK_MT2701_MMSYS | 1 + baseconfig/CONFIG_COMMON_CLK_MT2701_VDECSYS | 1 + baseconfig/CONFIG_DA280 | 1 + baseconfig/CONFIG_DA311 | 1 + baseconfig/CONFIG_DMARD10 | 1 + baseconfig/CONFIG_DMA_FENCE_TRACE | 1 + baseconfig/CONFIG_DPOT_DAC | 1 + baseconfig/CONFIG_DRM_DW_HDMI_I2S_AUDIO | 1 + baseconfig/CONFIG_DRM_HISI_HIBMC | 1 + baseconfig/CONFIG_DRM_I2C_ADV7511_AUDIO | 1 + baseconfig/CONFIG_DRM_I915_ALPHA_SUPPORT | 1 + baseconfig/CONFIG_DRM_I915_CAPTURE_ERROR | 1 + baseconfig/CONFIG_DRM_I915_COMPRESS_ERROR | 1 + baseconfig/CONFIG_DRM_I915_GVT_KVMGT | 1 + .../CONFIG_DRM_I915_PRELIMINARY_HW_SUPPORT | 1 - baseconfig/CONFIG_DRM_MXSFB | 1 + baseconfig/CONFIG_DRM_SIL_SII8620 | 1 + baseconfig/CONFIG_DRM_TI_TFP410 | 1 + baseconfig/CONFIG_EFI_ALLOW_SECURE_BOOT_EXIT | 1 + baseconfig/CONFIG_EFI_SECURE_BOOT_LOCK_DOWN | 1 + baseconfig/CONFIG_ENVELOPE_DETECTOR | 1 + baseconfig/CONFIG_FENCE_TRACE | 1 - baseconfig/CONFIG_HT16K33 | 1 + baseconfig/CONFIG_HTS221 | 1 + baseconfig/CONFIG_IIO_CROS_EC_SENSORS | 1 + baseconfig/CONFIG_IIO_CROS_EC_SENSORS_COR | 1 + baseconfig/CONFIG_IIO_CROS_EC_SENSORS_CORE | 1 + baseconfig/CONFIG_INPUT_PM8XXX_VIBRATOR | 1 + baseconfig/CONFIG_INPUT_PMIC8XXX_PWRKEY | 1 + baseconfig/CONFIG_KEYBOARD_PMIC8XXX | 1 + baseconfig/CONFIG_LEDS_NIC78BX | 1 + baseconfig/CONFIG_LEDS_USER | 1 + baseconfig/CONFIG_LMP91000 | 1 + baseconfig/CONFIG_LOCK_DOWN_KERNEL | 1 + baseconfig/CONFIG_MFD_PM8XXX | 1 + baseconfig/CONFIG_MMC_SDHCI_CADENCE | 1 + baseconfig/CONFIG_MPU3050_I2C | 1 + baseconfig/CONFIG_MSM_GCC_8994 | 1 + baseconfig/CONFIG_NVME_FC | 1 + baseconfig/CONFIG_NVME_TARGET_FC | 1 + baseconfig/CONFIG_NVME_TARGET_FCLOOP | 1 + baseconfig/CONFIG_PINCTRL_MSM8994 | 1 + baseconfig/CONFIG_PINCTRL_SX150X | 1 + baseconfig/CONFIG_QCOM_ADSP_PIL | 1 + baseconfig/CONFIG_QCOM_CLK_RPM | 1 + baseconfig/CONFIG_QCOM_CLK_SMD_RPM | 1 + baseconfig/CONFIG_REMOTEPROC | 1 + baseconfig/CONFIG_RTC_DRV_PM8XXX | 1 + baseconfig/CONFIG_SCR24X | 1 + baseconfig/CONFIG_SENSORS_TC654 | 1 + baseconfig/CONFIG_SENSORS_TMP108 | 1 + baseconfig/CONFIG_SPI_ARMADA_3700 | 1 + baseconfig/CONFIG_SPI_FSL_LPSPI | 1 + baseconfig/CONFIG_SUN50I_A64_CCU | 1 + baseconfig/CONFIG_TEST_ASYNC_DRIVER_PROBE | 1 + baseconfig/CONFIG_UIO_HV_GENERIC | 1 + baseconfig/CONFIG_USB_SERIAL_F8153X | 1 + baseconfig/CONFIG_VFIO_MDEV | 1 + baseconfig/CONFIG_VFIO_MDEV_DEVICE | 1 + baseconfig/arm/arm64/CONFIG_ACPI_APEI | 1 + baseconfig/arm/arm64/CONFIG_ACPI_APEI_EINJ | 1 + .../arm/arm64/CONFIG_ACPI_APEI_ERST_DEBUG | 1 + baseconfig/arm/arm64/CONFIG_ACPI_APEI_GHES | 1 + baseconfig/arm/arm64/CONFIG_ACPI_APEI_PCIEAER | 1 + .../arm/arm64/CONFIG_ARM64_PTDUMP_DEBUGFS | 1 + baseconfig/arm/arm64/CONFIG_DEBUG_WX | 1 + baseconfig/x86/CONFIG_AMD_XGBE | 1 + baseconfig/x86/CONFIG_AMD_XGBE_DCB | 1 + baseconfig/x86/CONFIG_APPLE_PROPERTIES | 1 + .../x86/CONFIG_EFI_ALLOW_SECURE_BOOT_EXIT | 1 + .../x86/CONFIG_EFI_SECURE_BOOT_LOCK_DOWN | 1 + baseconfig/x86/CONFIG_LOCK_DOWN_KERNEL | 1 + baseconfig/x86/CONFIG_SCHED_MC_PRIO | 1 + bcm283x-vc4-fixes.patch | 43 - drm-i915-hush-check-crtc-state.patch | 2 +- efi-lockdown.patch | 2159 +++++++++++++++++ gitrev | 2 +- ...able-in-a-signed-modules-environment.patch | 39 - kernel-aarch64-debug.config | 80 +- kernel-aarch64.config | 80 +- kernel-armv7hl-debug.config | 68 +- kernel-armv7hl-lpae-debug.config | 74 +- kernel-armv7hl-lpae.config | 74 +- kernel-armv7hl.config | 68 +- kernel-i686-PAE.config | 74 +- kernel-i686-PAEdebug.config | 74 +- kernel-i686-debug.config | 74 +- kernel-i686.config | 74 +- kernel-ppc64-debug.config | 74 +- kernel-ppc64.config | 74 +- kernel-ppc64le-debug.config | 74 +- kernel-ppc64le.config | 74 +- kernel-ppc64p7-debug.config | 74 +- kernel-ppc64p7.config | 74 +- kernel-s390x-debug.config | 74 +- kernel-s390x.config | 74 +- kernel-x86_64-debug.config | 74 +- kernel-x86_64.config | 74 +- kernel.spec | 44 +- ...-runtime-if-the-kernel-enforces-modu.patch | 44 - ...copy-secure_boot-flag-in-boot-params.patch | 30 - ...validate_disk-prevent-NULL-ptr-deref.patch | 2 +- sources | 2 +- ...-port-access-when-module-security-is.patch | 72 - ...-access-when-module-loading-is-restr.patch | 44 - 129 files changed, 3696 insertions(+), 1051 deletions(-) delete mode 100644 ACPI-Limit-access-to-custom_method.patch delete mode 100644 Add-secure_modules-call.patch delete mode 100644 Add-sysrq-option-to-disable-secure-boot-mode.patch delete mode 100644 PCI-Lock-down-BAR-access-when-module-security-is-ena.patch delete mode 100644 Restrict-dev-mem-and-dev-kmem-when-module-loading-is.patch delete mode 100644 acpi-Ignore-acpi_rsdp-kernel-parameter-when-module-l.patch delete mode 100644 arm64-ACPI-parse-SPCR-table.patch delete mode 100644 asus-wmi-Restrict-debugfs-interface-when-module-load.patch create mode 100644 baseconfig/CONFIG_ABP060MG create mode 100644 baseconfig/CONFIG_AD7766 create mode 100644 baseconfig/CONFIG_ARM64_SW_TTBR0_PAN create mode 100644 baseconfig/CONFIG_BCM2835_VCHIQ create mode 100644 baseconfig/CONFIG_BLK_DEV_ZONED create mode 100644 baseconfig/CONFIG_BLK_WBT create mode 100644 baseconfig/CONFIG_BLK_WBT_MQ create mode 100644 baseconfig/CONFIG_BLK_WBT_SQ create mode 100644 baseconfig/CONFIG_COMMON_CLK_HI3516CV300 create mode 100644 baseconfig/CONFIG_COMMON_CLK_HI3798CV200 create mode 100644 baseconfig/CONFIG_COMMON_CLK_MT2701 create mode 100644 baseconfig/CONFIG_COMMON_CLK_MT2701_BDPSYS create mode 100644 baseconfig/CONFIG_COMMON_CLK_MT2701_ETHSYS create mode 100644 baseconfig/CONFIG_COMMON_CLK_MT2701_HIFSYS create mode 100644 baseconfig/CONFIG_COMMON_CLK_MT2701_IMGSYS create mode 100644 baseconfig/CONFIG_COMMON_CLK_MT2701_MMSYS create mode 100644 baseconfig/CONFIG_COMMON_CLK_MT2701_VDECSYS create mode 100644 baseconfig/CONFIG_DA280 create mode 100644 baseconfig/CONFIG_DA311 create mode 100644 baseconfig/CONFIG_DMARD10 create mode 100644 baseconfig/CONFIG_DMA_FENCE_TRACE create mode 100644 baseconfig/CONFIG_DPOT_DAC create mode 100644 baseconfig/CONFIG_DRM_DW_HDMI_I2S_AUDIO create mode 100644 baseconfig/CONFIG_DRM_HISI_HIBMC create mode 100644 baseconfig/CONFIG_DRM_I2C_ADV7511_AUDIO create mode 100644 baseconfig/CONFIG_DRM_I915_ALPHA_SUPPORT create mode 100644 baseconfig/CONFIG_DRM_I915_CAPTURE_ERROR create mode 100644 baseconfig/CONFIG_DRM_I915_COMPRESS_ERROR create mode 100644 baseconfig/CONFIG_DRM_I915_GVT_KVMGT delete mode 100644 baseconfig/CONFIG_DRM_I915_PRELIMINARY_HW_SUPPORT create mode 100644 baseconfig/CONFIG_DRM_MXSFB create mode 100644 baseconfig/CONFIG_DRM_SIL_SII8620 create mode 100644 baseconfig/CONFIG_DRM_TI_TFP410 create mode 100644 baseconfig/CONFIG_EFI_ALLOW_SECURE_BOOT_EXIT create mode 100644 baseconfig/CONFIG_EFI_SECURE_BOOT_LOCK_DOWN create mode 100644 baseconfig/CONFIG_ENVELOPE_DETECTOR delete mode 100644 baseconfig/CONFIG_FENCE_TRACE create mode 100644 baseconfig/CONFIG_HT16K33 create mode 100644 baseconfig/CONFIG_HTS221 create mode 100644 baseconfig/CONFIG_IIO_CROS_EC_SENSORS create mode 100644 baseconfig/CONFIG_IIO_CROS_EC_SENSORS_COR create mode 100644 baseconfig/CONFIG_IIO_CROS_EC_SENSORS_CORE create mode 100644 baseconfig/CONFIG_INPUT_PM8XXX_VIBRATOR create mode 100644 baseconfig/CONFIG_INPUT_PMIC8XXX_PWRKEY create mode 100644 baseconfig/CONFIG_KEYBOARD_PMIC8XXX create mode 100644 baseconfig/CONFIG_LEDS_NIC78BX create mode 100644 baseconfig/CONFIG_LEDS_USER create mode 100644 baseconfig/CONFIG_LMP91000 create mode 100644 baseconfig/CONFIG_LOCK_DOWN_KERNEL create mode 100644 baseconfig/CONFIG_MFD_PM8XXX create mode 100644 baseconfig/CONFIG_MMC_SDHCI_CADENCE create mode 100644 baseconfig/CONFIG_MPU3050_I2C create mode 100644 baseconfig/CONFIG_MSM_GCC_8994 create mode 100644 baseconfig/CONFIG_NVME_FC create mode 100644 baseconfig/CONFIG_NVME_TARGET_FC create mode 100644 baseconfig/CONFIG_NVME_TARGET_FCLOOP create mode 100644 baseconfig/CONFIG_PINCTRL_MSM8994 create mode 100644 baseconfig/CONFIG_PINCTRL_SX150X create mode 100644 baseconfig/CONFIG_QCOM_ADSP_PIL create mode 100644 baseconfig/CONFIG_QCOM_CLK_RPM create mode 100644 baseconfig/CONFIG_QCOM_CLK_SMD_RPM create mode 100644 baseconfig/CONFIG_REMOTEPROC create mode 100644 baseconfig/CONFIG_RTC_DRV_PM8XXX create mode 100644 baseconfig/CONFIG_SCR24X create mode 100644 baseconfig/CONFIG_SENSORS_TC654 create mode 100644 baseconfig/CONFIG_SENSORS_TMP108 create mode 100644 baseconfig/CONFIG_SPI_ARMADA_3700 create mode 100644 baseconfig/CONFIG_SPI_FSL_LPSPI create mode 100644 baseconfig/CONFIG_SUN50I_A64_CCU create mode 100644 baseconfig/CONFIG_TEST_ASYNC_DRIVER_PROBE create mode 100644 baseconfig/CONFIG_UIO_HV_GENERIC create mode 100644 baseconfig/CONFIG_USB_SERIAL_F8153X create mode 100644 baseconfig/CONFIG_VFIO_MDEV create mode 100644 baseconfig/CONFIG_VFIO_MDEV_DEVICE create mode 100644 baseconfig/arm/arm64/CONFIG_ACPI_APEI create mode 100644 baseconfig/arm/arm64/CONFIG_ACPI_APEI_EINJ create mode 100644 baseconfig/arm/arm64/CONFIG_ACPI_APEI_ERST_DEBUG create mode 100644 baseconfig/arm/arm64/CONFIG_ACPI_APEI_GHES create mode 100644 baseconfig/arm/arm64/CONFIG_ACPI_APEI_PCIEAER create mode 100644 baseconfig/arm/arm64/CONFIG_ARM64_PTDUMP_DEBUGFS create mode 100644 baseconfig/arm/arm64/CONFIG_DEBUG_WX create mode 100644 baseconfig/x86/CONFIG_AMD_XGBE create mode 100644 baseconfig/x86/CONFIG_AMD_XGBE_DCB create mode 100644 baseconfig/x86/CONFIG_APPLE_PROPERTIES create mode 100644 baseconfig/x86/CONFIG_EFI_ALLOW_SECURE_BOOT_EXIT create mode 100644 baseconfig/x86/CONFIG_EFI_SECURE_BOOT_LOCK_DOWN create mode 100644 baseconfig/x86/CONFIG_LOCK_DOWN_KERNEL create mode 100644 baseconfig/x86/CONFIG_SCHED_MC_PRIO delete mode 100644 bcm283x-vc4-fixes.patch create mode 100644 efi-lockdown.patch delete mode 100644 hibernate-Disable-in-a-signed-modules-environment.patch delete mode 100644 kexec-Disable-at-runtime-if-the-kernel-enforces-modu.patch delete mode 100644 kexec-uefi-copy-secure_boot-flag-in-boot-params.patch delete mode 100644 x86-Lock-down-IO-port-access-when-module-security-is.patch delete mode 100644 x86-Restrict-MSR-access-when-module-loading-is-restr.patch diff --git a/ACPI-Limit-access-to-custom_method.patch b/ACPI-Limit-access-to-custom_method.patch deleted file mode 100644 index 44d2a004d..000000000 --- a/ACPI-Limit-access-to-custom_method.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 36d02761fc952f8190fca75bb4b81c2c7b7ddf68 Mon Sep 17 00:00:00 2001 -From: Matthew Garrett -Date: Fri, 9 Mar 2012 08:39:37 -0500 -Subject: [PATCH 04/20] ACPI: Limit access to custom_method - -custom_method effectively allows arbitrary access to system memory, making -it possible for an attacker to circumvent restrictions on module loading. -Disable it if any such restrictions have been enabled. - -Signed-off-by: Matthew Garrett ---- - drivers/acpi/custom_method.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/drivers/acpi/custom_method.c b/drivers/acpi/custom_method.c -index c68e72414a67..4277938af700 100644 ---- a/drivers/acpi/custom_method.c -+++ b/drivers/acpi/custom_method.c -@@ -29,6 +29,9 @@ static ssize_t cm_write(struct file *file, const char __user * user_buf, - struct acpi_table_header table; - acpi_status status; - -+ if (secure_modules()) -+ return -EPERM; -+ - if (!(*ppos)) { - /* parse the table header to get the table length */ - if (count <= sizeof(struct acpi_table_header)) --- -2.9.3 - diff --git a/Add-EFI-signature-data-types.patch b/Add-EFI-signature-data-types.patch index c376c48b3..40d14f949 100644 --- a/Add-EFI-signature-data-types.patch +++ b/Add-EFI-signature-data-types.patch @@ -19,8 +19,8 @@ index 5af91b58afae..190858d62fe3 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h @@ -603,6 +603,9 @@ void efi_native_runtime_setup(void); - #define LINUX_EFI_ARM_SCREEN_INFO_TABLE_GUID EFI_GUID(0xe03fc20a, 0x85dc, 0x406e, 0xb9, 0x0e, 0x4a, 0xb5, 0x02, 0x37, 0x1d, 0x95) #define LINUX_EFI_LOADER_ENTRY_GUID EFI_GUID(0x4a67b082, 0x0a4c, 0x41cf, 0xb6, 0xc7, 0x44, 0x0b, 0x29, 0xbb, 0x8c, 0x4f) + #define LINUX_EFI_RANDOM_SEED_TABLE_GUID EFI_GUID(0x1ce1e5bc, 0x7ceb, 0x42f2, 0x81, 0xe5, 0x8a, 0xad, 0xf1, 0x80, 0xf5, 0x7b) +#define EFI_CERT_SHA256_GUID EFI_GUID(0xc1c41626, 0x504c, 0x4092, 0xac, 0xa9, 0x41, 0xf9, 0x36, 0x93, 0x43, 0x28) +#define EFI_CERT_X509_GUID EFI_GUID(0xa5c059a1, 0x94e4, 0x4aa7, 0x87, 0xb5, 0xab, 0x15, 0x5c, 0x2b, 0xf0, 0x72) diff --git a/Add-secure_modules-call.patch b/Add-secure_modules-call.patch deleted file mode 100644 index 99d04c43e..000000000 --- a/Add-secure_modules-call.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 80d2d273b36b33d46820ab128c7a5b068389f643 Mon Sep 17 00:00:00 2001 -From: Matthew Garrett -Date: Fri, 9 Aug 2013 17:58:15 -0400 -Subject: [PATCH 01/20] Add secure_modules() call - -Provide a single call to allow kernel code to determine whether the system -has been configured to either disable module loading entirely or to load -only modules signed with a trusted key. - -Bugzilla: N/A -Upstream-status: Fedora mustard. Replaced by securelevels, but that was nak'd - -Signed-off-by: Matthew Garrett ---- - include/linux/module.h | 6 ++++++ - kernel/module.c | 10 ++++++++++ - 2 files changed, 16 insertions(+) - -diff --git a/include/linux/module.h b/include/linux/module.h -index 0c3207d26ac0..05bd6c989a0c 100644 ---- a/include/linux/module.h -+++ b/include/linux/module.h -@@ -641,6 +641,8 @@ static inline bool is_livepatch_module(struct module *mod) - } - #endif /* CONFIG_LIVEPATCH */ - -+extern bool secure_modules(void); -+ - #else /* !CONFIG_MODULES... */ - - static inline struct module *__module_address(unsigned long addr) -@@ -750,6 +752,10 @@ static inline bool module_requested_async_probing(struct module *module) - return false; - } - -+static inline bool secure_modules(void) -+{ -+ return false; -+} - #endif /* CONFIG_MODULES */ - - #ifdef CONFIG_SYSFS -diff --git a/kernel/module.c b/kernel/module.c -index f57dd63186e6..cb864505d020 100644 ---- a/kernel/module.c -+++ b/kernel/module.c -@@ -4284,3 +4284,13 @@ void module_layout(struct module *mod, - } - EXPORT_SYMBOL(module_layout); - #endif -+ -+bool secure_modules(void) -+{ -+#ifdef CONFIG_MODULE_SIG -+ return (sig_enforce || modules_disabled); -+#else -+ return modules_disabled; -+#endif -+} -+EXPORT_SYMBOL(secure_modules); --- -2.9.3 - diff --git a/Add-sysrq-option-to-disable-secure-boot-mode.patch b/Add-sysrq-option-to-disable-secure-boot-mode.patch deleted file mode 100644 index edd6039f9..000000000 --- a/Add-sysrq-option-to-disable-secure-boot-mode.patch +++ /dev/null @@ -1,246 +0,0 @@ -From d9e0379e8d3cb51efe4e2b1a5a60c52c2c40bdfb Mon Sep 17 00:00:00 2001 -From: Kyle McMartin -Date: Fri, 30 Aug 2013 09:28:51 -0400 -Subject: [PATCH 20/20] Add sysrq option to disable secure boot mode - -Bugzilla: N/A -Upstream-status: Fedora mustard ---- - arch/x86/kernel/setup.c | 36 ++++++++++++++++++++++++++++++++++++ - drivers/input/misc/uinput.c | 1 + - drivers/tty/sysrq.c | 19 +++++++++++++------ - include/linux/input.h | 5 +++++ - include/linux/sysrq.h | 8 +++++++- - kernel/debug/kdb/kdb_main.c | 2 +- - kernel/module.c | 2 +- - 7 files changed, 64 insertions(+), 9 deletions(-) - -diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c -index b93183336674..dab2882927c2 100644 ---- a/arch/x86/kernel/setup.c -+++ b/arch/x86/kernel/setup.c -@@ -70,6 +70,11 @@ - #include - #include - -+#include -+#include -+#include -+#include -+ - #include