From 076e89a4298dd7cfdbc35571d5b89ec64e1f313e Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 15 Jul 2019 12:51:46 +0200 Subject: [PATCH] 5.2-stable patches added patches: drivers-base-cacheinfo-ensure-cpu-hotplug-work-is-done-before-intel-rdt.patch firmware-improve-lsm-ima-security-behaviour.patch input-synaptics-enable-smbus-on-t480-thinkpad-trackpad.patch nilfs2-do-not-use-unexported-cpu_to_le32-le32_to_cpu-in-uapi-header.patch --- ...otplug-work-is-done-before-intel-rdt.patch | 60 ++++++++ ...e-improve-lsm-ima-security-behaviour.patch | 44 ++++++ ...able-smbus-on-t480-thinkpad-trackpad.patch | 36 +++++ ...u_to_le32-le32_to_cpu-in-uapi-header.patch | 129 ++++++++++++++++++ queue-5.2/series | 4 + 5 files changed, 273 insertions(+) create mode 100644 queue-5.2/drivers-base-cacheinfo-ensure-cpu-hotplug-work-is-done-before-intel-rdt.patch create mode 100644 queue-5.2/firmware-improve-lsm-ima-security-behaviour.patch create mode 100644 queue-5.2/input-synaptics-enable-smbus-on-t480-thinkpad-trackpad.patch create mode 100644 queue-5.2/nilfs2-do-not-use-unexported-cpu_to_le32-le32_to_cpu-in-uapi-header.patch diff --git a/queue-5.2/drivers-base-cacheinfo-ensure-cpu-hotplug-work-is-done-before-intel-rdt.patch b/queue-5.2/drivers-base-cacheinfo-ensure-cpu-hotplug-work-is-done-before-intel-rdt.patch new file mode 100644 index 00000000000..78aefd344e5 --- /dev/null +++ b/queue-5.2/drivers-base-cacheinfo-ensure-cpu-hotplug-work-is-done-before-intel-rdt.patch @@ -0,0 +1,60 @@ +From 83b44fe343b5abfcb1b2261289bd0cfcfcfd60a8 Mon Sep 17 00:00:00 2001 +From: James Morse +Date: Mon, 24 Jun 2019 18:36:56 +0100 +Subject: drivers: base: cacheinfo: Ensure cpu hotplug work is done before Intel RDT + +From: James Morse + +commit 83b44fe343b5abfcb1b2261289bd0cfcfcfd60a8 upstream. + +The cacheinfo structures are alloced/freed by cpu online/offline +callbacks. Originally these were only used by sysfs to expose the +cache topology to user space. Without any in-kernel dependencies +CPUHP_AP_ONLINE_DYN was an appropriate choice. + +resctrl has started using these structures to identify CPUs that +share a cache. It updates its 'domain' structures from cpu +online/offline callbacks. These depend on the cacheinfo structures +(resctrl_online_cpu()->domain_add_cpu()->get_cache_id()-> + get_cpu_cacheinfo()). +These also run as CPUHP_AP_ONLINE_DYN. + +Now that there is an in-kernel dependency, move the cacheinfo +work earlier so we know its done before resctrl's CPUHP_AP_ONLINE_DYN +work runs. + +Fixes: 2264d9c74dda1 ("x86/intel_rdt: Build structures for each resource based on cache topology") +Cc: +Cc: Fenghua Yu +Cc: Reinette Chatre +Signed-off-by: James Morse +Link: https://lore.kernel.org/r/20190624173656.202407-1-james.morse@arm.com +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/base/cacheinfo.c | 3 ++- + include/linux/cpuhotplug.h | 1 + + 2 files changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/base/cacheinfo.c ++++ b/drivers/base/cacheinfo.c +@@ -655,7 +655,8 @@ static int cacheinfo_cpu_pre_down(unsign + + static int __init cacheinfo_sysfs_init(void) + { +- return cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "base/cacheinfo:online", ++ return cpuhp_setup_state(CPUHP_AP_BASE_CACHEINFO_ONLINE, ++ "base/cacheinfo:online", + cacheinfo_cpu_online, cacheinfo_cpu_pre_down); + } + device_initcall(cacheinfo_sysfs_init); +--- a/include/linux/cpuhotplug.h ++++ b/include/linux/cpuhotplug.h +@@ -176,6 +176,7 @@ enum cpuhp_state { + CPUHP_AP_WATCHDOG_ONLINE, + CPUHP_AP_WORKQUEUE_ONLINE, + CPUHP_AP_RCUTREE_ONLINE, ++ CPUHP_AP_BASE_CACHEINFO_ONLINE, + CPUHP_AP_ONLINE_DYN, + CPUHP_AP_ONLINE_DYN_END = CPUHP_AP_ONLINE_DYN + 30, + CPUHP_AP_X86_HPET_ONLINE, diff --git a/queue-5.2/firmware-improve-lsm-ima-security-behaviour.patch b/queue-5.2/firmware-improve-lsm-ima-security-behaviour.patch new file mode 100644 index 00000000000..f30290dc326 --- /dev/null +++ b/queue-5.2/firmware-improve-lsm-ima-security-behaviour.patch @@ -0,0 +1,44 @@ +From 2472d64af2d3561954e2f05365a67692bb852f2a Mon Sep 17 00:00:00 2001 +From: Sven Van Asbroeck +Date: Mon, 17 Jun 2019 14:23:54 -0400 +Subject: firmware: improve LSM/IMA security behaviour + +From: Sven Van Asbroeck + +commit 2472d64af2d3561954e2f05365a67692bb852f2a upstream. + +The firmware loader queries if LSM/IMA permits it to load firmware +via the sysfs fallback. Unfortunately, the code does the opposite: +it expressly permits sysfs fw loading if security_kernel_load_data( +LOADING_FIRMWARE) returns -EACCES. This happens because a +zero-on-success return value is cast to a bool that's true on success. + +Fix the return value handling so we get the correct behaviour. + +Fixes: 6e852651f28e ("firmware: add call to LSM hook before firmware sysfs fallback") +Cc: Stable +Cc: Mimi Zohar +Cc: Kees Cook +To: Luis Chamberlain +Cc: Greg Kroah-Hartman +Cc: "Rafael J. Wysocki" +Cc: linux-kernel@vger.kernel.org +Signed-off-by: Sven Van Asbroeck +Reviewed-by: Mimi Zohar +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/base/firmware_loader/fallback.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/base/firmware_loader/fallback.c ++++ b/drivers/base/firmware_loader/fallback.c +@@ -659,7 +659,7 @@ static bool fw_run_sysfs_fallback(enum f + /* Also permit LSMs and IMA to fail firmware sysfs fallback */ + ret = security_kernel_load_data(LOADING_FIRMWARE); + if (ret < 0) +- return ret; ++ return false; + + return fw_force_sysfs_fallback(opt_flags); + } diff --git a/queue-5.2/input-synaptics-enable-smbus-on-t480-thinkpad-trackpad.patch b/queue-5.2/input-synaptics-enable-smbus-on-t480-thinkpad-trackpad.patch new file mode 100644 index 00000000000..b5fd3a48b2c --- /dev/null +++ b/queue-5.2/input-synaptics-enable-smbus-on-t480-thinkpad-trackpad.patch @@ -0,0 +1,36 @@ +From abbe3acd7d72ab4633ade6bd24e8306b67e0add3 Mon Sep 17 00:00:00 2001 +From: Cole Rogers +Date: Mon, 1 Jul 2019 00:47:48 -0700 +Subject: Input: synaptics - enable SMBUS on T480 thinkpad trackpad + +From: Cole Rogers + +commit abbe3acd7d72ab4633ade6bd24e8306b67e0add3 upstream. + +Thinkpad t480 laptops had some touchpad features disabled, resulting in the +loss of pinch to activities in GNOME, on wayland, and other touch gestures +being slower. This patch adds the touchpad of the t480 to the smbus_pnp_ids +whitelist to enable the extra features. In my testing this does not break +suspend (on fedora, with wayland, and GNOME, using the rc-6 kernel), while +also fixing the feature on a T480. + +Signed-off-by: Cole Rogers +Acked-by: Benjamin Tissoires +Cc: stable@vger.kernel.org +Signed-off-by: Dmitry Torokhov +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/input/mouse/synaptics.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/input/mouse/synaptics.c ++++ b/drivers/input/mouse/synaptics.c +@@ -173,6 +173,7 @@ static const char * const smbus_pnp_ids[ + "LEN0072", /* X1 Carbon Gen 5 (2017) - Elan/ALPS trackpoint */ + "LEN0073", /* X1 Carbon G5 (Elantech) */ + "LEN0092", /* X1 Carbon 6 */ ++ "LEN0093", /* T480 */ + "LEN0096", /* X280 */ + "LEN0097", /* X280 -> ALPS trackpoint */ + "LEN200f", /* T450s */ diff --git a/queue-5.2/nilfs2-do-not-use-unexported-cpu_to_le32-le32_to_cpu-in-uapi-header.patch b/queue-5.2/nilfs2-do-not-use-unexported-cpu_to_le32-le32_to_cpu-in-uapi-header.patch new file mode 100644 index 00000000000..aaabf30717f --- /dev/null +++ b/queue-5.2/nilfs2-do-not-use-unexported-cpu_to_le32-le32_to_cpu-in-uapi-header.patch @@ -0,0 +1,129 @@ +From c32cc30c0544f13982ee0185d55f4910319b1a79 Mon Sep 17 00:00:00 2001 +From: Masahiro Yamada +Date: Thu, 11 Jul 2019 20:52:18 -0700 +Subject: nilfs2: do not use unexported cpu_to_le32()/le32_to_cpu() in uapi header + +From: Masahiro Yamada + +commit c32cc30c0544f13982ee0185d55f4910319b1a79 upstream. + +cpu_to_le32/le32_to_cpu is defined in include/linux/byteorder/generic.h, +which is not exported to user-space. + +UAPI headers must use the ones prefixed with double-underscore. + +Detected by compile-testing exported headers: + + include/linux/nilfs2_ondisk.h: In function `nilfs_checkpoint_set_snapshot': + include/linux/nilfs2_ondisk.h:536:17: error: implicit declaration of function `cpu_to_le32' [-Werror=implicit-function-declaration] + cp->cp_flags = cpu_to_le32(le32_to_cpu(cp->cp_flags) | \ + ^ + include/linux/nilfs2_ondisk.h:552:1: note: in expansion of macro `NILFS_CHECKPOINT_FNS' + NILFS_CHECKPOINT_FNS(SNAPSHOT, snapshot) + ^~~~~~~~~~~~~~~~~~~~ + include/linux/nilfs2_ondisk.h:536:29: error: implicit declaration of function `le32_to_cpu' [-Werror=implicit-function-declaration] + cp->cp_flags = cpu_to_le32(le32_to_cpu(cp->cp_flags) | \ + ^ + include/linux/nilfs2_ondisk.h:552:1: note: in expansion of macro `NILFS_CHECKPOINT_FNS' + NILFS_CHECKPOINT_FNS(SNAPSHOT, snapshot) + ^~~~~~~~~~~~~~~~~~~~ + include/linux/nilfs2_ondisk.h: In function `nilfs_segment_usage_set_clean': + include/linux/nilfs2_ondisk.h:622:19: error: implicit declaration of function `cpu_to_le64' [-Werror=implicit-function-declaration] + su->su_lastmod = cpu_to_le64(0); + ^~~~~~~~~~~ + +Link: http://lkml.kernel.org/r/20190605053006.14332-1-yamada.masahiro@socionext.com +Fixes: e63e88bc53ba ("nilfs2: move ioctl interface and disk layout to uapi separately") +Signed-off-by: Masahiro Yamada +Acked-by: Ryusuke Konishi +Cc: Arnd Bergmann +Cc: Greg KH +Cc: Joe Perches +Cc: [4.9+] +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + include/uapi/linux/nilfs2_ondisk.h | 24 ++++++++++++------------ + 1 file changed, 12 insertions(+), 12 deletions(-) + +--- a/include/uapi/linux/nilfs2_ondisk.h ++++ b/include/uapi/linux/nilfs2_ondisk.h +@@ -29,7 +29,7 @@ + + #include + #include +- ++#include + + #define NILFS_INODE_BMAP_SIZE 7 + +@@ -533,19 +533,19 @@ enum { + static inline void \ + nilfs_checkpoint_set_##name(struct nilfs_checkpoint *cp) \ + { \ +- cp->cp_flags = cpu_to_le32(le32_to_cpu(cp->cp_flags) | \ +- (1UL << NILFS_CHECKPOINT_##flag)); \ ++ cp->cp_flags = __cpu_to_le32(__le32_to_cpu(cp->cp_flags) | \ ++ (1UL << NILFS_CHECKPOINT_##flag)); \ + } \ + static inline void \ + nilfs_checkpoint_clear_##name(struct nilfs_checkpoint *cp) \ + { \ +- cp->cp_flags = cpu_to_le32(le32_to_cpu(cp->cp_flags) & \ ++ cp->cp_flags = __cpu_to_le32(__le32_to_cpu(cp->cp_flags) & \ + ~(1UL << NILFS_CHECKPOINT_##flag)); \ + } \ + static inline int \ + nilfs_checkpoint_##name(const struct nilfs_checkpoint *cp) \ + { \ +- return !!(le32_to_cpu(cp->cp_flags) & \ ++ return !!(__le32_to_cpu(cp->cp_flags) & \ + (1UL << NILFS_CHECKPOINT_##flag)); \ + } + +@@ -595,20 +595,20 @@ enum { + static inline void \ + nilfs_segment_usage_set_##name(struct nilfs_segment_usage *su) \ + { \ +- su->su_flags = cpu_to_le32(le32_to_cpu(su->su_flags) | \ ++ su->su_flags = __cpu_to_le32(__le32_to_cpu(su->su_flags) | \ + (1UL << NILFS_SEGMENT_USAGE_##flag));\ + } \ + static inline void \ + nilfs_segment_usage_clear_##name(struct nilfs_segment_usage *su) \ + { \ + su->su_flags = \ +- cpu_to_le32(le32_to_cpu(su->su_flags) & \ ++ __cpu_to_le32(__le32_to_cpu(su->su_flags) & \ + ~(1UL << NILFS_SEGMENT_USAGE_##flag)); \ + } \ + static inline int \ + nilfs_segment_usage_##name(const struct nilfs_segment_usage *su) \ + { \ +- return !!(le32_to_cpu(su->su_flags) & \ ++ return !!(__le32_to_cpu(su->su_flags) & \ + (1UL << NILFS_SEGMENT_USAGE_##flag)); \ + } + +@@ -619,15 +619,15 @@ NILFS_SEGMENT_USAGE_FNS(ERROR, error) + static inline void + nilfs_segment_usage_set_clean(struct nilfs_segment_usage *su) + { +- su->su_lastmod = cpu_to_le64(0); +- su->su_nblocks = cpu_to_le32(0); +- su->su_flags = cpu_to_le32(0); ++ su->su_lastmod = __cpu_to_le64(0); ++ su->su_nblocks = __cpu_to_le32(0); ++ su->su_flags = __cpu_to_le32(0); + } + + static inline int + nilfs_segment_usage_clean(const struct nilfs_segment_usage *su) + { +- return !le32_to_cpu(su->su_flags); ++ return !__le32_to_cpu(su->su_flags); + } + + /** diff --git a/queue-5.2/series b/queue-5.2/series index 1bd1db664ba..c60dac706fd 100644 --- a/queue-5.2/series +++ b/queue-5.2/series @@ -1,2 +1,6 @@ revert-e1000e-fix-cyclic-resets-at-link-up-with-active-tx.patch e1000e-start-network-tx-queue-only-when-link-is-up.patch +input-synaptics-enable-smbus-on-t480-thinkpad-trackpad.patch +nilfs2-do-not-use-unexported-cpu_to_le32-le32_to_cpu-in-uapi-header.patch +drivers-base-cacheinfo-ensure-cpu-hotplug-work-is-done-before-intel-rdt.patch +firmware-improve-lsm-ima-security-behaviour.patch -- 2.47.2