From: Greg Kroah-Hartman Date: Fri, 24 Apr 2020 10:12:28 +0000 (+0200) Subject: 4.9-stable patches X-Git-Tag: v4.19.119~55 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=51c6a4bcc75ff7d804eb9b6eea631bcdf19b01d4;p=thirdparty%2Fkernel%2Fstable-queue.git 4.9-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 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 --- diff --git a/queue-4.9/crypto-mxs-dcp-make-symbols-sha1_null_hash-and-sha256_null_hash-static.patch b/queue-4.9/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.9/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.9/drm-msm-use-the-correct-dma_sync-calls-harder.patch b/queue-4.9/drm-msm-use-the-correct-dma_sync-calls-harder.patch new file mode 100644 index 00000000000..ba6061116c9 --- /dev/null +++ b/queue-4.9/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 +@@ -58,7 +58,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 { +@@ -71,7 +71,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.9/net-ipv4-avoid-unused-variable-warning-for-sysctl.patch b/queue-4.9/net-ipv4-avoid-unused-variable-warning-for-sysctl.patch new file mode 100644 index 00000000000..24ed61e4784 --- /dev/null +++ b/queue-4.9/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 +@@ -131,8 +131,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. + */ +@@ -2712,6 +2710,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.9/net-ipv4-emulate-read_once-on-hdrincl-bit-field-in-raw_sendmsg.patch b/queue-4.9/net-ipv4-emulate-read_once-on-hdrincl-bit-field-in-raw_sendmsg.patch new file mode 100644 index 00000000000..dc7efed5368 --- /dev/null +++ b/queue-4.9/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 +@@ -509,9 +509,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.9/series b/queue-4.9/series index cb481c941cb..71e40dfc317 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -1 +1,6 @@ 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 +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.9/vti4-removed-duplicate-log-message.patch b/queue-4.9/vti4-removed-duplicate-log-message.patch new file mode 100644 index 00000000000..6bb4caab230 --- /dev/null +++ b/queue-4.9/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 +@@ -696,10 +696,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);