]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
fixes for 4.14
authorSasha Levin <sashal@kernel.org>
Fri, 7 Feb 2020 02:08:04 +0000 (21:08 -0500)
committerSasha Levin <sashal@kernel.org>
Fri, 7 Feb 2020 02:08:04 +0000 (21:08 -0500)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-4.14/mmc-sdhci-of-at91-fix-memleak-on-clk_get-failure.patch [new file with mode: 0644]
queue-4.14/pci-keystone-fix-link-training-retries-initiation.patch [new file with mode: 0644]
queue-4.14/series
queue-4.14/ubifs-don-t-trigger-assertion-on-invalid-no-key-file.patch [new file with mode: 0644]

diff --git a/queue-4.14/mmc-sdhci-of-at91-fix-memleak-on-clk_get-failure.patch b/queue-4.14/mmc-sdhci-of-at91-fix-memleak-on-clk_get-failure.patch
new file mode 100644 (file)
index 0000000..216f3d5
--- /dev/null
@@ -0,0 +1,60 @@
+From 79fe4557f6532f5e6fb303ca175ac1abe6a99cbe Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 2 Jan 2020 11:42:16 +0100
+Subject: mmc: sdhci-of-at91: fix memleak on clk_get failure
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Michał Mirosław <mirq-linux@rere.qmqm.pl>
+
+[ Upstream commit a04184ce777b46e92c2b3c93c6dcb2754cb005e1 ]
+
+sdhci_alloc_host() does its work not using managed infrastructure, so
+needs explicit free on error path. Add it where needed.
+
+Cc: <stable@vger.kernel.org>
+Fixes: bb5f8ea4d514 ("mmc: sdhci-of-at91: introduce driver for the Atmel SDMMC")
+Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
+Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com>
+Acked-by: Adrian Hunter <adrian.hunter@intel.com>
+Link: https://lore.kernel.org/r/b2a44d5be2e06ff075f32477e466598bb0f07b36.1577961679.git.mirq-linux@rere.qmqm.pl
+Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/mmc/host/sdhci-of-at91.c | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/mmc/host/sdhci-of-at91.c b/drivers/mmc/host/sdhci-of-at91.c
+index 564e7be21e068..1dadd460cc8fb 100644
+--- a/drivers/mmc/host/sdhci-of-at91.c
++++ b/drivers/mmc/host/sdhci-of-at91.c
+@@ -331,19 +331,22 @@ static int sdhci_at91_probe(struct platform_device *pdev)
+       priv->mainck = devm_clk_get(&pdev->dev, "baseclk");
+       if (IS_ERR(priv->mainck)) {
+               dev_err(&pdev->dev, "failed to get baseclk\n");
+-              return PTR_ERR(priv->mainck);
++              ret = PTR_ERR(priv->mainck);
++              goto sdhci_pltfm_free;
+       }
+       priv->hclock = devm_clk_get(&pdev->dev, "hclock");
+       if (IS_ERR(priv->hclock)) {
+               dev_err(&pdev->dev, "failed to get hclock\n");
+-              return PTR_ERR(priv->hclock);
++              ret = PTR_ERR(priv->hclock);
++              goto sdhci_pltfm_free;
+       }
+       priv->gck = devm_clk_get(&pdev->dev, "multclk");
+       if (IS_ERR(priv->gck)) {
+               dev_err(&pdev->dev, "failed to get multclk\n");
+-              return PTR_ERR(priv->gck);
++              ret = PTR_ERR(priv->gck);
++              goto sdhci_pltfm_free;
+       }
+       ret = sdhci_at91_set_clks_presets(&pdev->dev);
+-- 
+2.20.1
+
diff --git a/queue-4.14/pci-keystone-fix-link-training-retries-initiation.patch b/queue-4.14/pci-keystone-fix-link-training-retries-initiation.patch
new file mode 100644 (file)
index 0000000..7f24354
--- /dev/null
@@ -0,0 +1,40 @@
+From bd193cfef1591c4e8821ae7f9e93b2120e38675a Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 17 Dec 2019 14:38:36 +0300
+Subject: PCI: keystone: Fix link training retries initiation
+
+From: Yurii Monakov <monakov.y@gmail.com>
+
+[ Upstream commit 6df19872d881641e6394f93ef2938cffcbdae5bb ]
+
+ks_pcie_stop_link() function does not clear LTSSM_EN_VAL bit so
+link training was not triggered more than once after startup.
+In configurations where link can be unstable during early boot,
+for example, under low temperature, it will never be established.
+
+Fixes: 0c4ffcfe1fbc ("PCI: keystone: Add TI Keystone PCIe driver")
+Signed-off-by: Yurii Monakov <monakov.y@gmail.com>
+Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
+Acked-by: Andrew Murray <andrew.murray@arm.com>
+Cc: stable@vger.kernel.org
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/pci/dwc/pci-keystone-dw.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/pci/dwc/pci-keystone-dw.c b/drivers/pci/dwc/pci-keystone-dw.c
+index 2fb20b887d2a5..4cf2662930d86 100644
+--- a/drivers/pci/dwc/pci-keystone-dw.c
++++ b/drivers/pci/dwc/pci-keystone-dw.c
+@@ -510,7 +510,7 @@ void ks_dw_pcie_initiate_link_train(struct keystone_pcie *ks_pcie)
+       /* Disable Link training */
+       val = ks_dw_app_readl(ks_pcie, CMD_STATUS);
+       val &= ~LTSSM_EN_VAL;
+-      ks_dw_app_writel(ks_pcie, CMD_STATUS, LTSSM_EN_VAL | val);
++      ks_dw_app_writel(ks_pcie, CMD_STATUS, val);
+       /* Initiate Link Training */
+       val = ks_dw_app_readl(ks_pcie, CMD_STATUS);
+-- 
+2.20.1
+
index 21351811bc9c0296c155c2560ca799e86e533b89..da58823a6d03d0ade5bd83d4cb0ea900aae57880 100644 (file)
@@ -39,3 +39,6 @@ alarmtimer-unregister-wakeup-source-when-module-get-fails.patch
 ubifs-reject-unsupported-ioctl-flags-explicitly.patch
 ubifs-fix-fs_ioc_setflags-unexpectedly-clearing-encrypt-flag.patch
 ubifs-fix-deadlock-in-concurrent-bulk-read-and-writepage.patch
+pci-keystone-fix-link-training-retries-initiation.patch
+mmc-sdhci-of-at91-fix-memleak-on-clk_get-failure.patch
+ubifs-don-t-trigger-assertion-on-invalid-no-key-file.patch
diff --git a/queue-4.14/ubifs-don-t-trigger-assertion-on-invalid-no-key-file.patch b/queue-4.14/ubifs-don-t-trigger-assertion-on-invalid-no-key-file.patch
new file mode 100644 (file)
index 0000000..62e048d
--- /dev/null
@@ -0,0 +1,53 @@
+From 08ddbcc83631432aa7d90e01f93718c4b10f219a Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 20 Jan 2020 14:31:59 -0800
+Subject: ubifs: don't trigger assertion on invalid no-key filename
+
+From: Eric Biggers <ebiggers@google.com>
+
+[ Upstream commit f0d07a98a070bb5e443df19c3aa55693cbca9341 ]
+
+If userspace provides an invalid fscrypt no-key filename which encodes a
+hash value with any of the UBIFS node type bits set (i.e. the high 3
+bits), gracefully report ENOENT rather than triggering ubifs_assert().
+
+Test case with kvm-xfstests shell:
+
+    . fs/ubifs/config
+    . ~/xfstests/common/encrypt
+    dev=$(__blkdev_to_ubi_volume /dev/vdc)
+    ubiupdatevol $dev -t
+    mount $dev /mnt -t ubifs
+    mkdir /mnt/edir
+    xfs_io -c set_encpolicy /mnt/edir
+    rm /mnt/edir/_,,,,,DAAAAAAAAAAAAAAAAAAAAAAAAAA
+
+With the bug, the following assertion fails on the 'rm' command:
+
+    [   19.066048] UBIFS error (ubi0:0 pid 379): ubifs_assert_failed: UBIFS assert failed: !(hash & ~UBIFS_S_KEY_HASH_MASK), in fs/ubifs/key.h:170
+
+Fixes: f4f61d2cc6d8 ("ubifs: Implement encrypted filenames")
+Cc: <stable@vger.kernel.org> # v4.10+
+Link: https://lore.kernel.org/r/20200120223201.241390-5-ebiggers@kernel.org
+Signed-off-by: Eric Biggers <ebiggers@google.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ fs/ubifs/dir.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c
+index 4e6e32c0c08a4..358abc26dbc0b 100644
+--- a/fs/ubifs/dir.c
++++ b/fs/ubifs/dir.c
+@@ -253,6 +253,8 @@ static struct dentry *ubifs_lookup(struct inode *dir, struct dentry *dentry,
+       if (nm.hash) {
+               ubifs_assert(fname_len(&nm) == 0);
+               ubifs_assert(fname_name(&nm) == NULL);
++              if (nm.hash & ~UBIFS_S_KEY_HASH_MASK)
++                      goto done; /* ENOENT */
+               dent_key_init_hash(c, &key, dir->i_ino, nm.hash);
+               err = ubifs_tnc_lookup_dh(c, &key, dent, nm.minor_hash);
+       } else {
+-- 
+2.20.1
+