From: Sasha Levin Date: Sun, 14 Feb 2021 16:45:00 +0000 (-0500) Subject: Fixes for 4.9 X-Git-Tag: v5.4.99~37 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=53cb4974dc9038d9654136c5f3212f8c30a4e364;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 4.9 Signed-off-by: Sasha Levin --- diff --git a/queue-4.9/arm-dts-lpc32xx-revert-set-default-clock-rate-of-hcl.patch b/queue-4.9/arm-dts-lpc32xx-revert-set-default-clock-rate-of-hcl.patch new file mode 100644 index 00000000000..48666910db7 --- /dev/null +++ b/queue-4.9/arm-dts-lpc32xx-revert-set-default-clock-rate-of-hcl.patch @@ -0,0 +1,47 @@ +From 966a0509c60ae84775a6b4293640824497ebdbd3 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 3 Feb 2021 10:03:20 +0100 +Subject: ARM: dts: lpc32xx: Revert set default clock rate of HCLK PLL + +From: Alexandre Belloni + +[ Upstream commit 5638159f6d93b99ec9743ac7f65563fca3cf413d ] + +This reverts commit c17e9377aa81664d94b4f2102559fcf2a01ec8e7. + +The lpc32xx clock driver is not able to actually change the PLL rate as +this would require reparenting ARM_CLK, DDRAM_CLK, PERIPH_CLK to SYSCLK, +then stop the PLL, update the register, restart the PLL and wait for the +PLL to lock and finally reparent ARM_CLK, DDRAM_CLK, PERIPH_CLK to HCLK +PLL. + +Currently, the HCLK driver simply updates the registers but this has no +real effect and all the clock rate calculation end up being wrong. This is +especially annoying for the peripheral (e.g. UARTs, I2C, SPI). + +Signed-off-by: Alexandre Belloni +Tested-by: Gregory CLEMENT +Link: https://lore.kernel.org/r/20210203090320.GA3760268@piout.net' +Signed-off-by: Arnd Bergmann +Signed-off-by: Sasha Levin +--- + arch/arm/boot/dts/lpc32xx.dtsi | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/arch/arm/boot/dts/lpc32xx.dtsi b/arch/arm/boot/dts/lpc32xx.dtsi +index 2802c9565b6ca..976a75a4eb2c6 100644 +--- a/arch/arm/boot/dts/lpc32xx.dtsi ++++ b/arch/arm/boot/dts/lpc32xx.dtsi +@@ -323,9 +323,6 @@ + + clocks = <&xtal_32k>, <&xtal>; + clock-names = "xtal_32k", "xtal"; +- +- assigned-clocks = <&clk LPC32XX_CLK_HCLK_PLL>; +- assigned-clock-rates = <208000000>; + }; + }; + +-- +2.27.0 + diff --git a/queue-4.9/ovl-skip-getxattr-of-security-labels.patch b/queue-4.9/ovl-skip-getxattr-of-security-labels.patch new file mode 100644 index 00000000000..8ba1810c1c1 --- /dev/null +++ b/queue-4.9/ovl-skip-getxattr-of-security-labels.patch @@ -0,0 +1,74 @@ +From 1abfc0b24a44739b253a7fc9a364940772ea6eaf Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 19 Dec 2020 12:16:08 +0200 +Subject: ovl: skip getxattr of security labels + +From: Amir Goldstein + +[ Upstream commit 03fedf93593c82538b18476d8c4f0e8f8435ea70 ] + +When inode has no listxattr op of its own (e.g. squashfs) vfs_listxattr +calls the LSM inode_listsecurity hooks to list the xattrs that LSMs will +intercept in inode_getxattr hooks. + +When selinux LSM is installed but not initialized, it will list the +security.selinux xattr in inode_listsecurity, but will not intercept it +in inode_getxattr. This results in -ENODATA for a getxattr call for an +xattr returned by listxattr. + +This situation was manifested as overlayfs failure to copy up lower +files from squashfs when selinux is built-in but not initialized, +because ovl_copy_xattr() iterates the lower inode xattrs by +vfs_listxattr() and vfs_getxattr(). + +ovl_copy_xattr() skips copy up of security labels that are indentified by +inode_copy_up_xattr LSM hooks, but it does that after vfs_getxattr(). +Since we are not going to copy them, skip vfs_getxattr() of the security +labels. + +Reported-by: Michael Labriola +Tested-by: Michael Labriola +Link: https://lore.kernel.org/linux-unionfs/2nv9d47zt7.fsf@aldarion.sourceruckus.org/ +Signed-off-by: Amir Goldstein +Signed-off-by: Miklos Szeredi +Signed-off-by: Sasha Levin +--- + fs/overlayfs/copy_up.c | 15 ++++++++------- + 1 file changed, 8 insertions(+), 7 deletions(-) + +diff --git a/fs/overlayfs/copy_up.c b/fs/overlayfs/copy_up.c +index 299dbf59f28f8..3a583aa1fafeb 100644 +--- a/fs/overlayfs/copy_up.c ++++ b/fs/overlayfs/copy_up.c +@@ -92,6 +92,14 @@ int ovl_copy_xattr(struct dentry *old, struct dentry *new) + + if (ovl_is_private_xattr(name)) + continue; ++ ++ error = security_inode_copy_up_xattr(name); ++ if (error < 0 && error != -EOPNOTSUPP) ++ break; ++ if (error == 1) { ++ error = 0; ++ continue; /* Discard */ ++ } + retry: + size = vfs_getxattr(old, name, value, value_size); + if (size == -ERANGE) +@@ -115,13 +123,6 @@ retry: + goto retry; + } + +- error = security_inode_copy_up_xattr(name); +- if (error < 0 && error != -EOPNOTSUPP) +- break; +- if (error == 1) { +- error = 0; +- continue; /* Discard */ +- } + error = vfs_setxattr(new, name, value, size, 0); + if (error) + break; +-- +2.27.0 + diff --git a/queue-4.9/series b/queue-4.9/series index cf3f658e085..2a46b463f95 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -18,3 +18,5 @@ squashfs-add-more-sanity-checks-in-inode-lookup.patch squashfs-add-more-sanity-checks-in-xattr-id-lookup.patch tracing-do-not-count-ftrace-events-in-top-level-enable-output.patch tracing-check-length-before-giving-out-the-filter-buffer.patch +ovl-skip-getxattr-of-security-labels.patch +arm-dts-lpc32xx-revert-set-default-clock-rate-of-hcl.patch