From: Sasha Levin Date: Mon, 5 Oct 2020 01:50:03 +0000 (-0400) Subject: Fixes for 4.9 X-Git-Tag: v4.19.150~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fdbd91a89ac5603431d120d99c373e1db7466832;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 4.9 Signed-off-by: Sasha Levin --- diff --git a/queue-4.9/clk-samsung-exynos4-mark-chipid-clock-as-clk_ignore_.patch b/queue-4.9/clk-samsung-exynos4-mark-chipid-clock-as-clk_ignore_.patch new file mode 100644 index 00000000000..04a61bae5b6 --- /dev/null +++ b/queue-4.9/clk-samsung-exynos4-mark-chipid-clock-as-clk_ignore_.patch @@ -0,0 +1,52 @@ +From c3945c7fd3a6c6c4a2aa17b65f9be5acd41e2181 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 22 Sep 2020 14:40:46 +0200 +Subject: clk: samsung: exynos4: mark 'chipid' clock as CLK_IGNORE_UNUSED + +From: Marek Szyprowski + +[ Upstream commit f3bb0f796f5ffe32f0fbdce5b1b12eb85511158f ] + +The ChipID IO region has it's own clock, which is being disabled while +scanning for unused clocks. It turned out that some CPU hotplug, CPU idle +or even SOC firmware code depends on the reads from that area. Fix the +mysterious hang caused by entering deep CPU idle state by ignoring the +'chipid' clock during unused clocks scan, as there are no direct clients +for it which will keep it enabled. + +Fixes: e062b571777f ("clk: exynos4: register clocks using common clock framework") +Signed-off-by: Marek Szyprowski +Link: https://lore.kernel.org/r/20200922124046.10496-1-m.szyprowski@samsung.com +Reviewed-by: Krzysztof Kozlowski +Acked-by: Sylwester Nawrocki +Signed-off-by: Stephen Boyd +Signed-off-by: Sasha Levin +--- + drivers/clk/samsung/clk-exynos4.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/clk/samsung/clk-exynos4.c b/drivers/clk/samsung/clk-exynos4.c +index 91f9b79e39411..9a9402f568ef6 100644 +--- a/drivers/clk/samsung/clk-exynos4.c ++++ b/drivers/clk/samsung/clk-exynos4.c +@@ -1060,7 +1060,7 @@ static const struct samsung_gate_clock exynos4210_gate_clks[] __initconst = { + GATE(CLK_PCIE, "pcie", "aclk133", GATE_IP_FSYS, 14, 0, 0), + GATE(CLK_SMMU_PCIE, "smmu_pcie", "aclk133", GATE_IP_FSYS, 18, 0, 0), + GATE(CLK_MODEMIF, "modemif", "aclk100", GATE_IP_PERIL, 28, 0, 0), +- GATE(CLK_CHIPID, "chipid", "aclk100", E4210_GATE_IP_PERIR, 0, 0, 0), ++ GATE(CLK_CHIPID, "chipid", "aclk100", E4210_GATE_IP_PERIR, 0, CLK_IGNORE_UNUSED, 0), + GATE(CLK_SYSREG, "sysreg", "aclk100", E4210_GATE_IP_PERIR, 0, + CLK_IGNORE_UNUSED, 0), + GATE(CLK_HDMI_CEC, "hdmi_cec", "aclk100", E4210_GATE_IP_PERIR, 11, 0, +@@ -1101,7 +1101,7 @@ static const struct samsung_gate_clock exynos4x12_gate_clks[] __initconst = { + 0), + GATE(CLK_TSADC, "tsadc", "aclk133", E4X12_GATE_BUS_FSYS1, 16, 0, 0), + GATE(CLK_MIPI_HSI, "mipi_hsi", "aclk133", GATE_IP_FSYS, 10, 0, 0), +- GATE(CLK_CHIPID, "chipid", "aclk100", E4X12_GATE_IP_PERIR, 0, 0, 0), ++ GATE(CLK_CHIPID, "chipid", "aclk100", E4X12_GATE_IP_PERIR, 0, CLK_IGNORE_UNUSED, 0), + GATE(CLK_SYSREG, "sysreg", "aclk100", E4X12_GATE_IP_PERIR, 1, + CLK_IGNORE_UNUSED, 0), + GATE(CLK_HDMI_CEC, "hdmi_cec", "aclk100", E4X12_GATE_IP_PERIR, 11, 0, +-- +2.25.1 + diff --git a/queue-4.9/i2c-cpm-fix-i2c_ram-structure.patch b/queue-4.9/i2c-cpm-fix-i2c_ram-structure.patch new file mode 100644 index 00000000000..5bbd7dd6d50 --- /dev/null +++ b/queue-4.9/i2c-cpm-fix-i2c_ram-structure.patch @@ -0,0 +1,45 @@ +From aab61ae1847bec9c6f5f3edc8243cbfec74e7bfe Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 23 Sep 2020 16:08:40 +0200 +Subject: i2c: cpm: Fix i2c_ram structure + +From: Nicolas VINCENT + +[ Upstream commit a2bd970aa62f2f7f80fd0d212b1d4ccea5df4aed ] + +the i2c_ram structure is missing the sdmatmp field mentionned in +datasheet for MPC8272 at paragraph 36.5. With this field missing, the +hardware would write past the allocated memory done through +cpm_muram_alloc for the i2c_ram structure and land in memory allocated +for the buffers descriptors corrupting the cbd_bufaddr field. Since this +field is only set during setup(), the first i2c transaction would work +and the following would send data read from an arbitrary memory +location. + +Fixes: 61045dbe9d8d ("i2c: Add support for I2C bus on Freescale CPM1/CPM2 controllers") +Signed-off-by: Nicolas VINCENT +Acked-by: Jochen Friedrich +Acked-by: Christophe Leroy +Signed-off-by: Wolfram Sang +Signed-off-by: Sasha Levin +--- + drivers/i2c/busses/i2c-cpm.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/i2c/busses/i2c-cpm.c b/drivers/i2c/busses/i2c-cpm.c +index d89bde2c5da25..cf285b97a6422 100644 +--- a/drivers/i2c/busses/i2c-cpm.c ++++ b/drivers/i2c/busses/i2c-cpm.c +@@ -74,6 +74,9 @@ struct i2c_ram { + char res1[4]; /* Reserved */ + ushort rpbase; /* Relocation pointer */ + char res2[2]; /* Reserved */ ++ /* The following elements are only for CPM2 */ ++ char res3[4]; /* Reserved */ ++ uint sdmatmp; /* Internal */ + }; + + #define I2COM_START 0x80 +-- +2.25.1 + diff --git a/queue-4.9/iommu-exynos-add-missing-put_device-call-in-exynos_i.patch b/queue-4.9/iommu-exynos-add-missing-put_device-call-in-exynos_i.patch new file mode 100644 index 00000000000..1c8588df5a8 --- /dev/null +++ b/queue-4.9/iommu-exynos-add-missing-put_device-call-in-exynos_i.patch @@ -0,0 +1,51 @@ +From 635d2be8d9f2ce6deec8ba916076598879348fff Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 18 Sep 2020 09:13:35 +0800 +Subject: iommu/exynos: add missing put_device() call in + exynos_iommu_of_xlate() + +From: Yu Kuai + +[ Upstream commit 1a26044954a6d1f4d375d5e62392446af663be7a ] + +if of_find_device_by_node() succeed, exynos_iommu_of_xlate() doesn't have +a corresponding put_device(). Thus add put_device() to fix the exception +handling for this function implementation. + +Fixes: aa759fd376fb ("iommu/exynos: Add callback for initializing devices from device tree") +Signed-off-by: Yu Kuai +Acked-by: Marek Szyprowski +Link: https://lore.kernel.org/r/20200918011335.909141-1-yukuai3@huawei.com +Signed-off-by: Joerg Roedel +Signed-off-by: Sasha Levin +--- + drivers/iommu/exynos-iommu.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c +index beef59eb94fa7..626b434e7967a 100644 +--- a/drivers/iommu/exynos-iommu.c ++++ b/drivers/iommu/exynos-iommu.c +@@ -1265,13 +1265,17 @@ static int exynos_iommu_of_xlate(struct device *dev, + return -ENODEV; + + data = platform_get_drvdata(sysmmu); +- if (!data) ++ if (!data) { ++ put_device(&sysmmu->dev); + return -ENODEV; ++ } + + if (!owner) { + owner = kzalloc(sizeof(*owner), GFP_KERNEL); +- if (!owner) ++ if (!owner) { ++ put_device(&sysmmu->dev); + return -ENOMEM; ++ } + + INIT_LIST_HEAD(&owner->controllers); + dev->archdata.iommu = owner; +-- +2.25.1 + diff --git a/queue-4.9/nfs-fix-security-label-length-not-being-reset.patch b/queue-4.9/nfs-fix-security-label-length-not-being-reset.patch new file mode 100644 index 00000000000..cd6b1f250e1 --- /dev/null +++ b/queue-4.9/nfs-fix-security-label-length-not-being-reset.patch @@ -0,0 +1,50 @@ +From f544567c798d3bea546ea387806fd10ef1c8035b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 15 Sep 2020 16:42:52 -0500 +Subject: nfs: Fix security label length not being reset + +From: Jeffrey Mitchell + +[ Upstream commit d33030e2ee3508d65db5644551435310df86010e ] + +nfs_readdir_page_filler() iterates over entries in a directory, reusing +the same security label buffer, but does not reset the buffer's length. +This causes decode_attr_security_label() to return -ERANGE if an entry's +security label is longer than the previous one's. This error, in +nfs4_decode_dirent(), only gets passed up as -EAGAIN, which causes another +failed attempt to copy into the buffer. The second error is ignored and +the remaining entries do not show up in ls, specifically the getdents64() +syscall. + +Reproduce by creating multiple files in NFS and giving one of the later +files a longer security label. ls will not see that file nor any that are +added afterwards, though they will exist on the backend. + +In nfs_readdir_page_filler(), reset security label buffer length before +every reuse + +Signed-off-by: Jeffrey Mitchell +Fixes: b4487b935452 ("nfs: Fix getxattr kernel panic and memory overflow") +Signed-off-by: Trond Myklebust +Signed-off-by: Sasha Levin +--- + fs/nfs/dir.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c +index 2517fcd423b68..d405b5a14073a 100644 +--- a/fs/nfs/dir.c ++++ b/fs/nfs/dir.c +@@ -583,6 +583,9 @@ int nfs_readdir_page_filler(nfs_readdir_descriptor_t *desc, struct nfs_entry *en + xdr_set_scratch_buffer(&stream, page_address(scratch), PAGE_SIZE); + + do { ++ if (entry->label) ++ entry->label->len = NFS4_MAXLABELLEN; ++ + status = xdr_decode(desc, entry, &stream); + if (status != 0) { + if (status == -EAGAIN) +-- +2.25.1 + diff --git a/queue-4.9/random32-restore-__latent_entropy-attribute-on-net_r.patch b/queue-4.9/random32-restore-__latent_entropy-attribute-on-net_r.patch new file mode 100644 index 00000000000..6c78d715ba5 --- /dev/null +++ b/queue-4.9/random32-restore-__latent_entropy-attribute-on-net_r.patch @@ -0,0 +1,46 @@ +From 0cb9f83578b647576c9fa69c5acb953b678aae79 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 2 Oct 2020 17:16:11 +0200 +Subject: random32: Restore __latent_entropy attribute on net_rand_state + +From: Thibaut Sautereau + +[ Upstream commit 09a6b0bc3be793ca8cba580b7992d73e9f68f15d ] + +Commit f227e3ec3b5c ("random32: update the net random state on interrupt +and activity") broke compilation and was temporarily fixed by Linus in +83bdc7275e62 ("random32: remove net_rand_state from the latent entropy +gcc plugin") by entirely moving net_rand_state out of the things handled +by the latent_entropy GCC plugin. + +From what I understand when reading the plugin code, using the +__latent_entropy attribute on a declaration was the wrong part and +simply keeping the __latent_entropy attribute on the variable definition +was the correct fix. + +Fixes: 83bdc7275e62 ("random32: remove net_rand_state from the latent entropy gcc plugin") +Acked-by: Willy Tarreau +Cc: Emese Revfy +Signed-off-by: Thibaut Sautereau +Signed-off-by: Linus Torvalds +Signed-off-by: Sasha Levin +--- + lib/random32.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/random32.c b/lib/random32.c +index 889dab44bd747..d5c3137d93f49 100644 +--- a/lib/random32.c ++++ b/lib/random32.c +@@ -47,7 +47,7 @@ static inline void prandom_state_selftest(void) + } + #endif + +-DEFINE_PER_CPU(struct rnd_state, net_rand_state); ++DEFINE_PER_CPU(struct rnd_state, net_rand_state) __latent_entropy; + + /** + * prandom_u32_state - seeded pseudo-random number generator. +-- +2.25.1 + diff --git a/queue-4.9/series b/queue-4.9/series index cfa574c2228..c9107ed88d7 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -9,3 +9,8 @@ rndis_host-increase-sleep-time-in-the-query-response.patch drivers-net-wan-lapbether-make-skb-protocol-consiste.patch drivers-net-wan-hdlc-set-skb-protocol-before-transmi.patch mac80211-do-not-allow-bigger-vht-mpdus-than-the-hard.patch +nfs-fix-security-label-length-not-being-reset.patch +clk-samsung-exynos4-mark-chipid-clock-as-clk_ignore_.patch +iommu-exynos-add-missing-put_device-call-in-exynos_i.patch +i2c-cpm-fix-i2c_ram-structure.patch +random32-restore-__latent_entropy-attribute-on-net_r.patch