* [PATCH for-4.14.y 0/5] Stable commits picked up from lede project
@ 2018-07-17 8:08 Amit Pundir
2018-07-17 8:08 ` [PATCH for-4.14.y 1/5] PCI: exynos: Fix a potential init_clk_resources NULL pointer dereference Amit Pundir
` (5 more replies)
0 siblings, 6 replies; 9+ messages in thread
From: Amit Pundir @ 2018-07-17 8:08 UTC (permalink / raw)
To: Greg KH, Stable
Hi Greg,
For your consideration, stable commits picked up from lede source
tree https://git.lede-project.org/?p=source.git for 4.14.y.
Cherry-picked and build tested on Linux v4.14.55.
Regards,
Amit Pundir
Christian Lamparter (2):
crypto: crypto4xx - remove bad list_del
crypto: crypto4xx - fix crypto4xx_build_pdr, crypto4xx_build_sdr leak
Jaehoon Chung (1):
PCI: exynos: Fix a potential init_clk_resources NULL pointer
dereference
Jonas Gorski (2):
bcm63xx_enet: correct clock usage
bcm63xx_enet: do not write to random DMA channel on BCM6345
drivers/crypto/amcc/crypto4xx_core.c | 23 +++++++++----------
drivers/net/ethernet/broadcom/bcm63xx_enet.c | 34 ++++++++++++++++++++--------
drivers/pci/dwc/pci-exynos.c | 3 ++-
3 files changed, 38 insertions(+), 22 deletions(-)
--
2.7.4
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH for-4.14.y 1/5] PCI: exynos: Fix a potential init_clk_resources NULL pointer dereference
2018-07-17 8:08 [PATCH for-4.14.y 0/5] Stable commits picked up from lede project Amit Pundir
@ 2018-07-17 8:08 ` Amit Pundir
2018-07-17 8:08 ` [PATCH for-4.14.y 2/5] crypto: crypto4xx - remove bad list_del Amit Pundir
` (4 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Amit Pundir @ 2018-07-17 8:08 UTC (permalink / raw)
To: Greg KH, Stable; +Cc: Jaehoon Chung, Lorenzo Pieralisi
From: Jaehoon Chung <jh80.chung@samsung.com>
commit b5d6bc90c9129279d363ccbc02ad11e7b657c0b4 upstream.
In order to avoid triggering a NULL pointer dereference in
exynos_pcie_probe() a check must be put in place to detect if
the init_clk_resources hook is initialized before calling it.
Add the respective function pointer check in exynos_pcie_probe().
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
[lorenzo.pieralisi@arm.com: rewrote the commit log]
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
---
Cherry-picked from lede tree https://git.lede-project.org/?p=source.git
drivers/pci/dwc/pci-exynos.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/dwc/pci-exynos.c b/drivers/pci/dwc/pci-exynos.c
index 5596fdedbb94..ea03f1ec12a4 100644
--- a/drivers/pci/dwc/pci-exynos.c
+++ b/drivers/pci/dwc/pci-exynos.c
@@ -695,7 +695,8 @@ static int __init exynos_pcie_probe(struct platform_device *pdev)
return ret;
}
- if (ep->ops && ep->ops->get_clk_resources) {
+ if (ep->ops && ep->ops->get_clk_resources &&
+ ep->ops->init_clk_resources) {
ret = ep->ops->get_clk_resources(ep);
if (ret)
return ret;
--
2.7.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH for-4.14.y 2/5] crypto: crypto4xx - remove bad list_del
2018-07-17 8:08 [PATCH for-4.14.y 0/5] Stable commits picked up from lede project Amit Pundir
2018-07-17 8:08 ` [PATCH for-4.14.y 1/5] PCI: exynos: Fix a potential init_clk_resources NULL pointer dereference Amit Pundir
@ 2018-07-17 8:08 ` Amit Pundir
2018-07-17 8:08 ` [PATCH for-4.14.y 3/5] crypto: crypto4xx - fix crypto4xx_build_pdr, crypto4xx_build_sdr leak Amit Pundir
` (3 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Amit Pundir @ 2018-07-17 8:08 UTC (permalink / raw)
To: Greg KH, Stable; +Cc: Christian Lamparter, Herbert Xu
From: Christian Lamparter <chunkeey@googlemail.com>
commit a728a196d253530f17da5c86dc7dfbe58c5f7094 upstream.
alg entries are only added to the list, after the registration
was successful. If the registration failed, it was never added
to the list in the first place.
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
---
Cherry-picked from lede tree https://git.lede-project.org/?p=source.git
drivers/crypto/amcc/crypto4xx_core.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/crypto/amcc/crypto4xx_core.c b/drivers/crypto/amcc/crypto4xx_core.c
index 65dc78b91dea..3118cec0d81e 100644
--- a/drivers/crypto/amcc/crypto4xx_core.c
+++ b/drivers/crypto/amcc/crypto4xx_core.c
@@ -1033,12 +1033,10 @@ int crypto4xx_register_alg(struct crypto4xx_device *sec_dev,
break;
}
- if (rc) {
- list_del(&alg->entry);
+ if (rc)
kfree(alg);
- } else {
+ else
list_add_tail(&alg->entry, &sec_dev->alg_list);
- }
}
return 0;
--
2.7.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH for-4.14.y 3/5] crypto: crypto4xx - fix crypto4xx_build_pdr, crypto4xx_build_sdr leak
2018-07-17 8:08 [PATCH for-4.14.y 0/5] Stable commits picked up from lede project Amit Pundir
2018-07-17 8:08 ` [PATCH for-4.14.y 1/5] PCI: exynos: Fix a potential init_clk_resources NULL pointer dereference Amit Pundir
2018-07-17 8:08 ` [PATCH for-4.14.y 2/5] crypto: crypto4xx - remove bad list_del Amit Pundir
@ 2018-07-17 8:08 ` Amit Pundir
2018-07-17 8:08 ` [PATCH for-4.14.y 4/5] bcm63xx_enet: correct clock usage Amit Pundir
` (2 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Amit Pundir @ 2018-07-17 8:08 UTC (permalink / raw)
To: Greg KH, Stable; +Cc: Christian Lamparter, Herbert Xu
From: Christian Lamparter <chunkeey@googlemail.com>
commit 5d59ad6eea82ef8df92b4109615a0dde9d8093e9 upstream.
If one of the later memory allocations in rypto4xx_build_pdr()
fails: dev->pdr (and/or) dev->pdr_uinfo wouldn't be freed.
crypto4xx_build_sdr() has the same issue with dev->sdr.
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
---
Cherry-picked from lede tree https://git.lede-project.org/?p=source.git
drivers/crypto/amcc/crypto4xx_core.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/drivers/crypto/amcc/crypto4xx_core.c b/drivers/crypto/amcc/crypto4xx_core.c
index 3118cec0d81e..3f9eee7e555f 100644
--- a/drivers/crypto/amcc/crypto4xx_core.c
+++ b/drivers/crypto/amcc/crypto4xx_core.c
@@ -207,7 +207,7 @@ static u32 crypto4xx_build_pdr(struct crypto4xx_device *dev)
dev->pdr_pa);
return -ENOMEM;
}
- memset(dev->pdr, 0, sizeof(struct ce_pd) * PPC4XX_NUM_PD);
+ memset(dev->pdr, 0, sizeof(struct ce_pd) * PPC4XX_NUM_PD);
dev->shadow_sa_pool = dma_alloc_coherent(dev->core_dev->device,
256 * PPC4XX_NUM_PD,
&dev->shadow_sa_pool_pa,
@@ -240,13 +240,15 @@ static u32 crypto4xx_build_pdr(struct crypto4xx_device *dev)
static void crypto4xx_destroy_pdr(struct crypto4xx_device *dev)
{
- if (dev->pdr != NULL)
+ if (dev->pdr)
dma_free_coherent(dev->core_dev->device,
sizeof(struct ce_pd) * PPC4XX_NUM_PD,
dev->pdr, dev->pdr_pa);
+
if (dev->shadow_sa_pool)
dma_free_coherent(dev->core_dev->device, 256 * PPC4XX_NUM_PD,
dev->shadow_sa_pool, dev->shadow_sa_pool_pa);
+
if (dev->shadow_sr_pool)
dma_free_coherent(dev->core_dev->device,
sizeof(struct sa_state_record) * PPC4XX_NUM_PD,
@@ -416,12 +418,12 @@ static u32 crypto4xx_build_sdr(struct crypto4xx_device *dev)
static void crypto4xx_destroy_sdr(struct crypto4xx_device *dev)
{
- if (dev->sdr != NULL)
+ if (dev->sdr)
dma_free_coherent(dev->core_dev->device,
sizeof(struct ce_sd) * PPC4XX_NUM_SD,
dev->sdr, dev->sdr_pa);
- if (dev->scatter_buffer_va != NULL)
+ if (dev->scatter_buffer_va)
dma_free_coherent(dev->core_dev->device,
dev->scatter_buffer_size * PPC4XX_NUM_SD,
dev->scatter_buffer_va,
@@ -1191,7 +1193,7 @@ static int crypto4xx_probe(struct platform_device *ofdev)
rc = crypto4xx_build_gdr(core_dev->dev);
if (rc)
- goto err_build_gdr;
+ goto err_build_pdr;
rc = crypto4xx_build_sdr(core_dev->dev);
if (rc)
@@ -1234,12 +1236,11 @@ static int crypto4xx_probe(struct platform_device *ofdev)
err_request_irq:
irq_dispose_mapping(core_dev->irq);
tasklet_kill(&core_dev->tasklet);
- crypto4xx_destroy_sdr(core_dev->dev);
err_build_sdr:
+ crypto4xx_destroy_sdr(core_dev->dev);
crypto4xx_destroy_gdr(core_dev->dev);
-err_build_gdr:
- crypto4xx_destroy_pdr(core_dev->dev);
err_build_pdr:
+ crypto4xx_destroy_pdr(core_dev->dev);
kfree(core_dev->dev);
err_alloc_dev:
kfree(core_dev);
--
2.7.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH for-4.14.y 4/5] bcm63xx_enet: correct clock usage
2018-07-17 8:08 [PATCH for-4.14.y 0/5] Stable commits picked up from lede project Amit Pundir
` (2 preceding siblings ...)
2018-07-17 8:08 ` [PATCH for-4.14.y 3/5] crypto: crypto4xx - fix crypto4xx_build_pdr, crypto4xx_build_sdr leak Amit Pundir
@ 2018-07-17 8:08 ` Amit Pundir
2018-07-17 8:08 ` [PATCH for-4.14.y 5/5] bcm63xx_enet: do not write to random DMA channel on BCM6345 Amit Pundir
2018-07-17 8:13 ` [PATCH for-4.14.y 0/5] Stable commits picked up from lede project Greg KH
5 siblings, 0 replies; 9+ messages in thread
From: Amit Pundir @ 2018-07-17 8:08 UTC (permalink / raw)
To: Greg KH, Stable; +Cc: Jonas Gorski, David S . Miller
From: Jonas Gorski <jonas.gorski@gmail.com>
commit 9c86b846ce02f7e35d7234cf090b80553eba5389 upstream.
Check the return code of prepare_enable and change one last instance of
enable only to prepare_enable. Also properly disable and release the
clock in error paths and on remove for enetsw.
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
---
Cherry-picked from lede tree https://git.lede-project.org/?p=source.git
drivers/net/ethernet/broadcom/bcm63xx_enet.c | 31 +++++++++++++++++++++-------
1 file changed, 23 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
index 4f3845a58126..b7d8b6600be6 100644
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
@@ -1773,7 +1773,9 @@ static int bcm_enet_probe(struct platform_device *pdev)
ret = PTR_ERR(priv->mac_clk);
goto out;
}
- clk_prepare_enable(priv->mac_clk);
+ ret = clk_prepare_enable(priv->mac_clk);
+ if (ret)
+ goto out_put_clk_mac;
/* initialize default and fetch platform data */
priv->rx_ring_size = BCMENET_DEF_RX_DESC;
@@ -1805,9 +1807,11 @@ static int bcm_enet_probe(struct platform_device *pdev)
if (IS_ERR(priv->phy_clk)) {
ret = PTR_ERR(priv->phy_clk);
priv->phy_clk = NULL;
- goto out_put_clk_mac;
+ goto out_disable_clk_mac;
}
- clk_prepare_enable(priv->phy_clk);
+ ret = clk_prepare_enable(priv->phy_clk);
+ if (ret)
+ goto out_put_clk_phy;
}
/* do minimal hardware init to be able to probe mii bus */
@@ -1901,13 +1905,16 @@ static int bcm_enet_probe(struct platform_device *pdev)
out_uninit_hw:
/* turn off mdc clock */
enet_writel(priv, 0, ENET_MIISC_REG);
- if (priv->phy_clk) {
+ if (priv->phy_clk)
clk_disable_unprepare(priv->phy_clk);
+
+out_put_clk_phy:
+ if (priv->phy_clk)
clk_put(priv->phy_clk);
- }
-out_put_clk_mac:
+out_disable_clk_mac:
clk_disable_unprepare(priv->mac_clk);
+out_put_clk_mac:
clk_put(priv->mac_clk);
out:
free_netdev(dev);
@@ -2752,7 +2759,9 @@ static int bcm_enetsw_probe(struct platform_device *pdev)
ret = PTR_ERR(priv->mac_clk);
goto out_unmap;
}
- clk_enable(priv->mac_clk);
+ ret = clk_prepare_enable(priv->mac_clk);
+ if (ret)
+ goto out_put_clk;
priv->rx_chan = 0;
priv->tx_chan = 1;
@@ -2773,7 +2782,7 @@ static int bcm_enetsw_probe(struct platform_device *pdev)
ret = register_netdev(dev);
if (ret)
- goto out_put_clk;
+ goto out_disable_clk;
netif_carrier_off(dev);
platform_set_drvdata(pdev, dev);
@@ -2782,6 +2791,9 @@ static int bcm_enetsw_probe(struct platform_device *pdev)
return 0;
+out_disable_clk:
+ clk_disable_unprepare(priv->mac_clk);
+
out_put_clk:
clk_put(priv->mac_clk);
@@ -2813,6 +2825,9 @@ static int bcm_enetsw_remove(struct platform_device *pdev)
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
release_mem_region(res->start, resource_size(res));
+ clk_disable_unprepare(priv->mac_clk);
+ clk_put(priv->mac_clk);
+
free_netdev(dev);
return 0;
}
--
2.7.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH for-4.14.y 5/5] bcm63xx_enet: do not write to random DMA channel on BCM6345
2018-07-17 8:08 [PATCH for-4.14.y 0/5] Stable commits picked up from lede project Amit Pundir
` (3 preceding siblings ...)
2018-07-17 8:08 ` [PATCH for-4.14.y 4/5] bcm63xx_enet: correct clock usage Amit Pundir
@ 2018-07-17 8:08 ` Amit Pundir
2018-07-17 8:13 ` [PATCH for-4.14.y 0/5] Stable commits picked up from lede project Greg KH
5 siblings, 0 replies; 9+ messages in thread
From: Amit Pundir @ 2018-07-17 8:08 UTC (permalink / raw)
To: Greg KH, Stable; +Cc: Jonas Gorski, David S . Miller
From: Jonas Gorski <jonas.gorski@gmail.com>
commit d6213c1f2ad54a964b77471690264ed685718928 upstream.
The DMA controller regs actually point to DMA channel 0, so the write to
ENETDMA_CFG_REG will actually modify a random DMA channel.
Since DMA controller registers do not exist on BCM6345, guard the write
with the usual check for dma_has_sram.
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
---
Cherry-picked from lede tree https://git.lede-project.org/?p=source.git
drivers/net/ethernet/broadcom/bcm63xx_enet.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
index b7d8b6600be6..68470c7c630a 100644
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
@@ -1062,7 +1062,8 @@ static int bcm_enet_open(struct net_device *dev)
val = enet_readl(priv, ENET_CTL_REG);
val |= ENET_CTL_ENABLE_MASK;
enet_writel(priv, val, ENET_CTL_REG);
- enet_dma_writel(priv, ENETDMA_CFG_EN_MASK, ENETDMA_CFG_REG);
+ if (priv->dma_has_sram)
+ enet_dma_writel(priv, ENETDMA_CFG_EN_MASK, ENETDMA_CFG_REG);
enet_dmac_writel(priv, priv->dma_chan_en_mask,
ENETDMAC_CHANCFG, priv->rx_chan);
--
2.7.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH for-4.14.y 0/5] Stable commits picked up from lede project
2018-07-17 8:08 [PATCH for-4.14.y 0/5] Stable commits picked up from lede project Amit Pundir
` (4 preceding siblings ...)
2018-07-17 8:08 ` [PATCH for-4.14.y 5/5] bcm63xx_enet: do not write to random DMA channel on BCM6345 Amit Pundir
@ 2018-07-17 8:13 ` Greg KH
2018-07-17 8:24 ` Amit Pundir
5 siblings, 1 reply; 9+ messages in thread
From: Greg KH @ 2018-07-17 8:13 UTC (permalink / raw)
To: Amit Pundir; +Cc: Stable
On Tue, Jul 17, 2018 at 01:38:29PM +0530, Amit Pundir wrote:
> Hi Greg,
Welcome back! :)
> For your consideration, stable commits picked up from lede source
> tree https://git.lede-project.org/?p=source.git for 4.14.y.
>
> Cherry-picked and build tested on Linux v4.14.55.
Why only 4.14? These aren't needed further back? Just checking...
thanks,
greg k-h
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH for-4.14.y 0/5] Stable commits picked up from lede project
2018-07-17 8:13 ` [PATCH for-4.14.y 0/5] Stable commits picked up from lede project Greg KH
@ 2018-07-17 8:24 ` Amit Pundir
2018-07-18 10:13 ` Greg Kroah-Hartman
0 siblings, 1 reply; 9+ messages in thread
From: Amit Pundir @ 2018-07-17 8:24 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: stable
On Tue, 17 Jul 2018 at 13:43, Greg KH <gregkh@linuxfoundation.org> wrote:
>
> On Tue, Jul 17, 2018 at 01:38:29PM +0530, Amit Pundir wrote:
> > Hi Greg,
>
> Welcome back! :)
Sorry I've been sitting on few of these for a long time. Got stuck in
some other work items.
>
> > For your consideration, stable commits picked up from lede source
> > tree https://git.lede-project.org/?p=source.git for 4.14.y.
> >
> > Cherry-picked and build tested on Linux v4.14.55.
>
> Why only 4.14? These aren't needed further back? Just checking...
Sent few for 4.9 as well. Couple of these 4.14 ones are cleanly
applied on 4.9.y as well but they are not present on Lede's 4.9 tree,
so I don't know if they are useful for 4.9.y as such, so I skipped
them over.
Regards,
Amit Pundir
>
> thanks,
>
> greg k-h
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH for-4.14.y 0/5] Stable commits picked up from lede project
2018-07-17 8:24 ` Amit Pundir
@ 2018-07-18 10:13 ` Greg Kroah-Hartman
0 siblings, 0 replies; 9+ messages in thread
From: Greg Kroah-Hartman @ 2018-07-18 10:13 UTC (permalink / raw)
To: Amit Pundir; +Cc: stable
On Tue, Jul 17, 2018 at 01:54:49PM +0530, Amit Pundir wrote:
> On Tue, 17 Jul 2018 at 13:43, Greg KH <gregkh@linuxfoundation.org> wrote:
> >
> > On Tue, Jul 17, 2018 at 01:38:29PM +0530, Amit Pundir wrote:
> > > Hi Greg,
> >
> > Welcome back! :)
>
> Sorry I've been sitting on few of these for a long time. Got stuck in
> some other work items.
>
> >
> > > For your consideration, stable commits picked up from lede source
> > > tree https://git.lede-project.org/?p=source.git for 4.14.y.
> > >
> > > Cherry-picked and build tested on Linux v4.14.55.
> >
> > Why only 4.14? These aren't needed further back? Just checking...
>
> Sent few for 4.9 as well. Couple of these 4.14 ones are cleanly
> applied on 4.9.y as well but they are not present on Lede's 4.9 tree,
> so I don't know if they are useful for 4.9.y as such, so I skipped
> them over.
Well, it looks like they are relevant there, as well as for 4.4.y, so
I've applied them all over the place. Please be more "complete" if at
all possible next time.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2018-07-18 10:51 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-17 8:08 [PATCH for-4.14.y 0/5] Stable commits picked up from lede project Amit Pundir
2018-07-17 8:08 ` [PATCH for-4.14.y 1/5] PCI: exynos: Fix a potential init_clk_resources NULL pointer dereference Amit Pundir
2018-07-17 8:08 ` [PATCH for-4.14.y 2/5] crypto: crypto4xx - remove bad list_del Amit Pundir
2018-07-17 8:08 ` [PATCH for-4.14.y 3/5] crypto: crypto4xx - fix crypto4xx_build_pdr, crypto4xx_build_sdr leak Amit Pundir
2018-07-17 8:08 ` [PATCH for-4.14.y 4/5] bcm63xx_enet: correct clock usage Amit Pundir
2018-07-17 8:08 ` [PATCH for-4.14.y 5/5] bcm63xx_enet: do not write to random DMA channel on BCM6345 Amit Pundir
2018-07-17 8:13 ` [PATCH for-4.14.y 0/5] Stable commits picked up from lede project Greg KH
2018-07-17 8:24 ` Amit Pundir
2018-07-18 10:13 ` Greg Kroah-Hartman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).