From f7da903e1692474ac3b5b95ccba29ece8e9978d1 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 24 Apr 2020 12:12:44 +0200 Subject: [PATCH] 4.14-stable patches added patches: crypto-mxs-dcp-make-symbols-sha1_null_hash-and-sha256_null_hash-static.patch drm-msm-use-the-correct-dma_sync-calls-harder.patch keys-fix-the-use-of-the-c-keyword-private-in-uapi-linux-keyctl.h.patch net-ipv4-avoid-unused-variable-warning-for-sysctl.patch net-ipv4-emulate-read_once-on-hdrincl-bit-field-in-raw_sendmsg.patch vti4-removed-duplicate-log-message.patch --- ...ull_hash-and-sha256_null_hash-static.patch | 42 +++++++++++++ ...se-the-correct-dma_sync-calls-harder.patch | 60 ++++++++++++++++++ ...yword-private-in-uapi-linux-keyctl.h.patch | 62 +++++++++++++++++++ ...d-unused-variable-warning-for-sysctl.patch | 47 ++++++++++++++ ...-on-hdrincl-bit-field-in-raw_sendmsg.patch | 61 ++++++++++++++++++ queue-4.14/series | 6 ++ .../vti4-removed-duplicate-log-message.patch | 37 +++++++++++ 7 files changed, 315 insertions(+) create mode 100644 queue-4.14/crypto-mxs-dcp-make-symbols-sha1_null_hash-and-sha256_null_hash-static.patch create mode 100644 queue-4.14/drm-msm-use-the-correct-dma_sync-calls-harder.patch create mode 100644 queue-4.14/keys-fix-the-use-of-the-c-keyword-private-in-uapi-linux-keyctl.h.patch create mode 100644 queue-4.14/net-ipv4-avoid-unused-variable-warning-for-sysctl.patch create mode 100644 queue-4.14/net-ipv4-emulate-read_once-on-hdrincl-bit-field-in-raw_sendmsg.patch create mode 100644 queue-4.14/vti4-removed-duplicate-log-message.patch diff --git a/queue-4.14/crypto-mxs-dcp-make-symbols-sha1_null_hash-and-sha256_null_hash-static.patch b/queue-4.14/crypto-mxs-dcp-make-symbols-sha1_null_hash-and-sha256_null_hash-static.patch new file mode 100644 index 00000000000..0f3be1fd182 --- /dev/null +++ b/queue-4.14/crypto-mxs-dcp-make-symbols-sha1_null_hash-and-sha256_null_hash-static.patch @@ -0,0 +1,42 @@ +From ce4e45842de3eb54b8dd6e081765d741f5b92b56 Mon Sep 17 00:00:00 2001 +From: Wei Yongjun +Date: Thu, 11 Oct 2018 01:49:48 +0000 +Subject: crypto: mxs-dcp - make symbols 'sha1_null_hash' and 'sha256_null_hash' static + +From: Wei Yongjun + +commit ce4e45842de3eb54b8dd6e081765d741f5b92b56 upstream. + +Fixes the following sparse warnings: + +drivers/crypto/mxs-dcp.c:39:15: warning: + symbol 'sha1_null_hash' was not declared. Should it be static? +drivers/crypto/mxs-dcp.c:43:15: warning: + symbol 'sha256_null_hash' was not declared. Should it be static? + +Fixes: c709eebaf5c5 ("crypto: mxs-dcp - Fix SHA null hashes and output length") +Signed-off-by: Wei Yongjun +Signed-off-by: Herbert Xu +Cc: Guenter Roeck +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/crypto/mxs-dcp.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/crypto/mxs-dcp.c ++++ b/drivers/crypto/mxs-dcp.c +@@ -37,11 +37,11 @@ + * Null hashes to align with hw behavior on imx6sl and ull + * these are flipped for consistency with hw output + */ +-const uint8_t sha1_null_hash[] = ++static const uint8_t sha1_null_hash[] = + "\x09\x07\xd8\xaf\x90\x18\x60\x95\xef\xbf" + "\x55\x32\x0d\x4b\x6b\x5e\xee\xa3\x39\xda"; + +-const uint8_t sha256_null_hash[] = ++static const uint8_t sha256_null_hash[] = + "\x55\xb8\x52\x78\x1b\x99\x95\xa4" + "\x4c\x93\x9b\x64\xe4\x41\xae\x27" + "\x24\xb9\x6f\x99\xc8\xf4\xfb\x9a" diff --git a/queue-4.14/drm-msm-use-the-correct-dma_sync-calls-harder.patch b/queue-4.14/drm-msm-use-the-correct-dma_sync-calls-harder.patch new file mode 100644 index 00000000000..c94c692326d --- /dev/null +++ b/queue-4.14/drm-msm-use-the-correct-dma_sync-calls-harder.patch @@ -0,0 +1,60 @@ +From 9f614197c744002f9968e82c649fdf7fe778e1e7 Mon Sep 17 00:00:00 2001 +From: Rob Clark +Date: Wed, 4 Sep 2019 09:56:03 -0700 +Subject: drm/msm: Use the correct dma_sync calls harder + +From: Rob Clark + +commit 9f614197c744002f9968e82c649fdf7fe778e1e7 upstream. + +Looks like the dma_sync calls don't do what we want on armv7 either. +Fixes: + + Unable to handle kernel paging request at virtual address 50001000 + pgd = (ptrval) + [50001000] *pgd=00000000 + Internal error: Oops: 805 [#1] SMP ARM + Modules linked in: + CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.3.0-rc6-00271-g9f159ae07f07 #4 + Hardware name: Freescale i.MX53 (Device Tree Support) + PC is at v7_dma_clean_range+0x20/0x38 + LR is at __dma_page_cpu_to_dev+0x28/0x90 + pc : [] lr : [] psr: 20000013 + sp : d80b5a88 ip : de96c000 fp : d840ce6c + r10: 00000000 r9 : 00000001 r8 : d843e010 + r7 : 00000000 r6 : 00008000 r5 : ddb6c000 r4 : 00000000 + r3 : 0000003f r2 : 00000040 r1 : 50008000 r0 : 50001000 + Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none + Control: 10c5387d Table: 70004019 DAC: 00000051 + Process swapper/0 (pid: 1, stack limit = 0x(ptrval)) + +Signed-off-by: Rob Clark +Fixes: 3de433c5b38a ("drm/msm: Use the correct dma_sync calls in msm_gem") +Tested-by: Fabio Estevam +Cc: Guenter Roeck +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/msm/msm_gem.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/gpu/drm/msm/msm_gem.c ++++ b/drivers/gpu/drm/msm/msm_gem.c +@@ -61,7 +61,7 @@ static void sync_for_device(struct msm_g + { + struct device *dev = msm_obj->base.dev->dev; + +- if (get_dma_ops(dev)) { ++ if (get_dma_ops(dev) && IS_ENABLED(CONFIG_ARM64)) { + dma_sync_sg_for_device(dev, msm_obj->sgt->sgl, + msm_obj->sgt->nents, DMA_BIDIRECTIONAL); + } else { +@@ -74,7 +74,7 @@ static void sync_for_cpu(struct msm_gem_ + { + struct device *dev = msm_obj->base.dev->dev; + +- if (get_dma_ops(dev)) { ++ if (get_dma_ops(dev) && IS_ENABLED(CONFIG_ARM64)) { + dma_sync_sg_for_cpu(dev, msm_obj->sgt->sgl, + msm_obj->sgt->nents, DMA_BIDIRECTIONAL); + } else { diff --git a/queue-4.14/keys-fix-the-use-of-the-c-keyword-private-in-uapi-linux-keyctl.h.patch b/queue-4.14/keys-fix-the-use-of-the-c-keyword-private-in-uapi-linux-keyctl.h.patch new file mode 100644 index 00000000000..6dbfb7c3b5c --- /dev/null +++ b/queue-4.14/keys-fix-the-use-of-the-c-keyword-private-in-uapi-linux-keyctl.h.patch @@ -0,0 +1,62 @@ +From 2ecefa0a15fd0ef88b9cd5d15ceb813008136431 Mon Sep 17 00:00:00 2001 +From: David Howells +Date: Fri, 28 Sep 2018 00:51:20 +0100 +Subject: keys: Fix the use of the C++ keyword "private" in uapi/linux/keyctl.h + +From: David Howells + +commit 2ecefa0a15fd0ef88b9cd5d15ceb813008136431 upstream. + +The keyctl_dh_params struct in uapi/linux/keyctl.h contains the symbol +"private" which means that the header file will cause compilation failure +if #included in to a C++ program. Further, the patch that added the same +struct to the keyutils package named the symbol "priv", not "private". + +The previous attempt to fix this (commit 8a2336e549d3) did so by simply +renaming the kernel's copy of the field to dh_private, but this then breaks +existing userspace and as such has been reverted (commit 8c0f9f5b309d). + +[And note, to those who think that wrapping the struct in extern "C" {} + will work: it won't; that only changes how symbol names are presented to + the assembler and linker.]. + +Instead, insert an anonymous union around the "private" member and add a +second member in there with the name "priv" to match the one in the +keyutils package. The "private" member is then wrapped in !__cplusplus +cpp-conditionals to hide it from C++. + +Fixes: ddbb41148724 ("KEYS: Add KEYCTL_DH_COMPUTE command") +Fixes: 8a2336e549d3 ("uapi/linux/keyctl.h: don't use C++ reserved keyword as a struct member name") +Signed-off-by: David Howells +cc: Randy Dunlap +cc: Lubomir Rintel +cc: James Morris +cc: Mat Martineau +cc: Stephan Mueller +cc: Andrew Morton +cc: Linus Torvalds +cc: stable@vger.kernel.org +Signed-off-by: James Morris +Cc: Guenter Roeck +Signed-off-by: Greg Kroah-Hartman + +--- + include/uapi/linux/keyctl.h | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +--- a/include/uapi/linux/keyctl.h ++++ b/include/uapi/linux/keyctl.h +@@ -65,7 +65,12 @@ + + /* keyctl structures */ + struct keyctl_dh_params { +- __s32 private; ++ union { ++#ifndef __cplusplus ++ __s32 private; ++#endif ++ __s32 priv; ++ }; + __s32 prime; + __s32 base; + }; diff --git a/queue-4.14/net-ipv4-avoid-unused-variable-warning-for-sysctl.patch b/queue-4.14/net-ipv4-avoid-unused-variable-warning-for-sysctl.patch new file mode 100644 index 00000000000..0d20b0763bb --- /dev/null +++ b/queue-4.14/net-ipv4-avoid-unused-variable-warning-for-sysctl.patch @@ -0,0 +1,47 @@ +From 773daa3caf5d3f87fdb1ab43e9c1b367a38fa394 Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Wed, 28 Feb 2018 14:32:48 +0100 +Subject: net: ipv4: avoid unused variable warning for sysctl + +From: Arnd Bergmann + +commit 773daa3caf5d3f87fdb1ab43e9c1b367a38fa394 upstream. + +The newly introudced ip_min_valid_pmtu variable is only used when +CONFIG_SYSCTL is set: + +net/ipv4/route.c:135:12: error: 'ip_min_valid_pmtu' defined but not used [-Werror=unused-variable] + +This moves it to the other variables like it, to avoid the harmless +warning. + +Fixes: c7272c2f1229 ("net: ipv4: don't allow setting net.ipv4.route.min_pmtu below 68") +Signed-off-by: Arnd Bergmann +Acked-by: Sabrina Dubroca +Signed-off-by: David S. Miller +Cc: Guenter Roeck +Signed-off-by: Greg Kroah-Hartman + +--- + net/ipv4/route.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/net/ipv4/route.c ++++ b/net/ipv4/route.c +@@ -133,8 +133,6 @@ static int ip_rt_min_advmss __read_mostl + + static int ip_rt_gc_timeout __read_mostly = RT_GC_TIMEOUT; + +-static int ip_min_valid_pmtu __read_mostly = IPV4_MIN_MTU; +- + /* + * Interface to generic destination cache. + */ +@@ -2869,6 +2867,7 @@ void ip_rt_multicast_event(struct in_dev + static int ip_rt_gc_interval __read_mostly = 60 * HZ; + static int ip_rt_gc_min_interval __read_mostly = HZ / 2; + static int ip_rt_gc_elasticity __read_mostly = 8; ++static int ip_min_valid_pmtu __read_mostly = IPV4_MIN_MTU; + + static int ipv4_sysctl_rtcache_flush(struct ctl_table *__ctl, int write, + void __user *buffer, diff --git a/queue-4.14/net-ipv4-emulate-read_once-on-hdrincl-bit-field-in-raw_sendmsg.patch b/queue-4.14/net-ipv4-emulate-read_once-on-hdrincl-bit-field-in-raw_sendmsg.patch new file mode 100644 index 00000000000..0b4f68b19ff --- /dev/null +++ b/queue-4.14/net-ipv4-emulate-read_once-on-hdrincl-bit-field-in-raw_sendmsg.patch @@ -0,0 +1,61 @@ +From 20b50d79974ea3192e8c3ab7faf4e536e5f14d8f Mon Sep 17 00:00:00 2001 +From: Nicolai Stange +Date: Mon, 8 Jan 2018 15:54:44 +0100 +Subject: net: ipv4: emulate READ_ONCE() on ->hdrincl bit-field in raw_sendmsg() + +From: Nicolai Stange + +commit 20b50d79974ea3192e8c3ab7faf4e536e5f14d8f upstream. + +Commit 8f659a03a0ba ("net: ipv4: fix for a race condition in +raw_sendmsg") fixed the issue of possibly inconsistent ->hdrincl handling +due to concurrent updates by reading this bit-field member into a local +variable and using the thus stabilized value in subsequent tests. + +However, aforementioned commit also adds the (correct) comment that + + /* hdrincl should be READ_ONCE(inet->hdrincl) + * but READ_ONCE() doesn't work with bit fields + */ + +because as it stands, the compiler is free to shortcut or even eliminate +the local variable at its will. + +Note that I have not seen anything like this happening in reality and thus, +the concern is a theoretical one. + +However, in order to be on the safe side, emulate a READ_ONCE() on the +bit-field by doing it on the local 'hdrincl' variable itself: + + int hdrincl = inet->hdrincl; + hdrincl = READ_ONCE(hdrincl); + +This breaks the chain in the sense that the compiler is not allowed +to replace subsequent reads from hdrincl with reloads from inet->hdrincl. + +Fixes: 8f659a03a0ba ("net: ipv4: fix for a race condition in raw_sendmsg") +Signed-off-by: Nicolai Stange +Reviewed-by: Stefano Brivio +Signed-off-by: David S. Miller +Cc: Guenter Roeck +Signed-off-by: Greg Kroah-Hartman + +--- + net/ipv4/raw.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/net/ipv4/raw.c ++++ b/net/ipv4/raw.c +@@ -520,9 +520,11 @@ static int raw_sendmsg(struct sock *sk, + goto out; + + /* hdrincl should be READ_ONCE(inet->hdrincl) +- * but READ_ONCE() doesn't work with bit fields ++ * but READ_ONCE() doesn't work with bit fields. ++ * Doing this indirectly yields the same result. + */ + hdrincl = inet->hdrincl; ++ hdrincl = READ_ONCE(hdrincl); + /* + * Check the flags. + */ diff --git a/queue-4.14/series b/queue-4.14/series index cb481c941cb..ff3ee4510ef 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -1 +1,7 @@ ext4-fix-extent_status-fragmentation-for-plain-files.patch +net-ipv4-emulate-read_once-on-hdrincl-bit-field-in-raw_sendmsg.patch +net-ipv4-avoid-unused-variable-warning-for-sysctl.patch +keys-fix-the-use-of-the-c-keyword-private-in-uapi-linux-keyctl.h.patch +drm-msm-use-the-correct-dma_sync-calls-harder.patch +crypto-mxs-dcp-make-symbols-sha1_null_hash-and-sha256_null_hash-static.patch +vti4-removed-duplicate-log-message.patch diff --git a/queue-4.14/vti4-removed-duplicate-log-message.patch b/queue-4.14/vti4-removed-duplicate-log-message.patch new file mode 100644 index 00000000000..577b0ab0551 --- /dev/null +++ b/queue-4.14/vti4-removed-duplicate-log-message.patch @@ -0,0 +1,37 @@ +From 01ce31c57b3f07c91c9d45bbaf126124cce83a5d Mon Sep 17 00:00:00 2001 +From: Jeremy Sowden +Date: Tue, 19 Mar 2019 15:39:21 +0000 +Subject: vti4: removed duplicate log message. + +From: Jeremy Sowden + +commit 01ce31c57b3f07c91c9d45bbaf126124cce83a5d upstream. + +Removed info log-message if ipip tunnel registration fails during +module-initialization: it adds nothing to the error message that is +written on all failures. + +Fixes: dd9ee3444014e ("vti4: Fix a ipip packet processing bug in 'IPCOMP' virtual tunnel") +Signed-off-by: Jeremy Sowden +Signed-off-by: Steffen Klassert +Cc: Guenter Roeck +Signed-off-by: Greg Kroah-Hartman + +--- + net/ipv4/ip_vti.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +--- a/net/ipv4/ip_vti.c ++++ b/net/ipv4/ip_vti.c +@@ -681,10 +681,8 @@ static int __init vti_init(void) + + msg = "ipip tunnel"; + err = xfrm4_tunnel_register(&ipip_handler, AF_INET); +- if (err < 0) { +- pr_info("%s: cant't register tunnel\n",__func__); ++ if (err < 0) + goto xfrm_tunnel_failed; +- } + + msg = "netlink interface"; + err = rtnl_link_register(&vti_link_ops); -- 2.47.3