All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Patch "PCI: endpoint: Fix kernel panic after put_device()" has been added to the 4.16-stable tree
@ 2018-05-02 11:18 Rolf Evers-Fischer
  2018-05-02 15:38 ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Rolf Evers-Fischer @ 2018-05-02 11:18 UTC (permalink / raw)
  To: stable
  Cc: alexander.levin, andy.shevchenko, gregkh, kishon, lorenzo.pieralisi

On Wed, May 2, 2018 at 00:35 AM <gregkh@linuxfoundation.org> wrote:

> This is a note to let you know that I've just added the patch titled

>     PCI: endpoint: Fix kernel panic after put_device()

> to the 4.16-stable tree which can be found at:
    
> http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

> The filename of the patch is:
>      pci-endpoint-fix-kernel-panic-after-put_device.patch
> and it can be found in the queue-4.16 subdirectory.

> If you, or anyone else, feels it should not be added to the stable tree,
> please let <stable@vger.kernel.org> know about it.

This patch is the 2nd one of a series of patches. If you want to add it
to the stable tree without the first patch, you must add a

+		kfree(func_name);

before returning from the function.

The upstream commit of the first patch is
36cc14ac14c0d49d33820a82dab52a7edc802fef PCI: endpoint: Simplify name 
allocation for EPF device

Kind regards,
 Rolf

> From foo@baz Tue May  1 14:59:17 PDT 2018
> From: Rolf Evers-Fischer <rolf.evers.fischer@aptiv.com>
> Date: Wed, 28 Feb 2018 18:32:19 +0100
> Subject: PCI: endpoint: Fix kernel panic after put_device()

> From: Rolf Evers-Fischer <rolf.evers.fischer@aptiv.com>

> [ Upstream commit 9eef6a5c3b0bf90eb292d462ea267bcb6ad1c334 ]

> 'put_device()' calls the relase function 'pci_epf_dev_release()',
> which already frees 'epf->name' and 'epf'.

> Therefore we must not free them again after 'put_device()'.

> Fixes: 5e8cb4033807 ("PCI: endpoint: Add EP core layer to enable EP 
> controller and EP functions")

> Signed-off-by: Rolf Evers-Fischer <rolf.evers.fischer@aptiv.com>
> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
>  drivers/pci/endpoint/pci-epf-core.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

> --- a/drivers/pci/endpoint/pci-epf-core.c
> +++ b/drivers/pci/endpoint/pci-epf-core.c
> @@ -243,7 +243,7 @@ struct pci_epf *pci_epf_create(const cha
 
>  put_dev:
>          put_device(dev);
> -       kfree(epf->name);
> +       return ERR_PTR(ret);
 
>  free_func_name:
>          kfree(func_name);


> Patches currently in stable-queue which might be from 
> rolf.evers.fischer@aptiv.com are

> queue-4.16/pci-endpoint-fix-kernel-panic-after-put_device.patch

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Patch "PCI: endpoint: Fix kernel panic after put_device()" has been added to the 4.16-stable tree
  2018-05-02 11:18 Patch "PCI: endpoint: Fix kernel panic after put_device()" has been added to the 4.16-stable tree Rolf Evers-Fischer
@ 2018-05-02 15:38 ` Greg KH
  2018-05-02 15:51   ` Rolf Evers-Fischer
  0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2018-05-02 15:38 UTC (permalink / raw)
  To: Rolf Evers-Fischer
  Cc: stable, alexander.levin, andy.shevchenko, kishon, lorenzo.pieralisi

On Wed, May 02, 2018 at 01:18:07PM +0200, Rolf Evers-Fischer wrote:
> On Wed, May 2, 2018 at 00:35 AM <gregkh@linuxfoundation.org> wrote:
> 
> > This is a note to let you know that I've just added the patch titled
> 
> >     PCI: endpoint: Fix kernel panic after put_device()
> 
> > to the 4.16-stable tree which can be found at:
>     
> > http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
> 
> > The filename of the patch is:
> >      pci-endpoint-fix-kernel-panic-after-put_device.patch
> > and it can be found in the queue-4.16 subdirectory.
> 
> > If you, or anyone else, feels it should not be added to the stable tree,
> > please let <stable@vger.kernel.org> know about it.
> 
> This patch is the 2nd one of a series of patches. If you want to add it
> to the stable tree without the first patch, you must add a
> 
> +		kfree(func_name);
> 
> before returning from the function.
> 
> The upstream commit of the first patch is
> 36cc14ac14c0d49d33820a82dab52a7edc802fef PCI: endpoint: Simplify name 
> allocation for EPF device

Thanks for letting me know, I'll just drop this patch as without the
first one, this isn't needed and isn't an issue, right?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Patch "PCI: endpoint: Fix kernel panic after put_device()" has been added to the 4.16-stable tree
  2018-05-02 15:38 ` Greg KH
@ 2018-05-02 15:51   ` Rolf Evers-Fischer
  2018-05-02 15:58     ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Rolf Evers-Fischer @ 2018-05-02 15:51 UTC (permalink / raw)
  To: Greg KH
  Cc: Rolf Evers-Fischer, stable, alexander.levin, andy.shevchenko,
	kishon, lorenzo.pieralisi



On Wed, 2 May 2018, Greg KH wrote:

> On Wed, May 02, 2018 at 01:18:07PM +0200, Rolf Evers-Fischer wrote:
> > On Wed, May 2, 2018 at 00:35 AM <gregkh@linuxfoundation.org> wrote:
> > 
> > > This is a note to let you know that I've just added the patch titled
> > 
> > >     PCI: endpoint: Fix kernel panic after put_device()
> > 
> > > to the 4.16-stable tree which can be found at:
> >     
> > > http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
> > 
> > > The filename of the patch is:
> > >      pci-endpoint-fix-kernel-panic-after-put_device.patch
> > > and it can be found in the queue-4.16 subdirectory.
> > 
> > > If you, or anyone else, feels it should not be added to the stable tree,
> > > please let <stable@vger.kernel.org> know about it.
> > 
> > This patch is the 2nd one of a series of patches. If you want to add it
> > to the stable tree without the first patch, you must add a
> > 
> > +		kfree(func_name);
> > 
> > before returning from the function.
> > 
> > The upstream commit of the first patch is
> > 36cc14ac14c0d49d33820a82dab52a7edc802fef PCI: endpoint: Simplify name 
> > allocation for EPF device
> 
> Thanks for letting me know, I'll just drop this patch as without the
> first one, this isn't needed and isn't an issue, right?
> 
> thanks,
> 
> greg k-h
> 

It is still an issue (even without the first one!), but it will only occur 
on PCI endpoints when setting the devicename or adding the device fails.
Therefore I think you can drop this patch for the stable series.

Thank you,
 Rolf

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Patch "PCI: endpoint: Fix kernel panic after put_device()" has been added to the 4.16-stable tree
  2018-05-02 15:51   ` Rolf Evers-Fischer
@ 2018-05-02 15:58     ` Greg KH
  0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2018-05-02 15:58 UTC (permalink / raw)
  To: Rolf Evers-Fischer
  Cc: stable, alexander.levin, andy.shevchenko, kishon, lorenzo.pieralisi

On Wed, May 02, 2018 at 05:51:40PM +0200, Rolf Evers-Fischer wrote:
> 
> 
> On Wed, 2 May 2018, Greg KH wrote:
> 
> > On Wed, May 02, 2018 at 01:18:07PM +0200, Rolf Evers-Fischer wrote:
> > > On Wed, May 2, 2018 at 00:35 AM <gregkh@linuxfoundation.org> wrote:
> > > 
> > > > This is a note to let you know that I've just added the patch titled
> > > 
> > > >     PCI: endpoint: Fix kernel panic after put_device()
> > > 
> > > > to the 4.16-stable tree which can be found at:
> > >     
> > > > http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
> > > 
> > > > The filename of the patch is:
> > > >      pci-endpoint-fix-kernel-panic-after-put_device.patch
> > > > and it can be found in the queue-4.16 subdirectory.
> > > 
> > > > If you, or anyone else, feels it should not be added to the stable tree,
> > > > please let <stable@vger.kernel.org> know about it.
> > > 
> > > This patch is the 2nd one of a series of patches. If you want to add it
> > > to the stable tree without the first patch, you must add a
> > > 
> > > +		kfree(func_name);
> > > 
> > > before returning from the function.
> > > 
> > > The upstream commit of the first patch is
> > > 36cc14ac14c0d49d33820a82dab52a7edc802fef PCI: endpoint: Simplify name 
> > > allocation for EPF device
> > 
> > Thanks for letting me know, I'll just drop this patch as without the
> > first one, this isn't needed and isn't an issue, right?
> > 
> > thanks,
> > 
> > greg k-h
> > 
> 
> It is still an issue (even without the first one!), but it will only occur 
> on PCI endpoints when setting the devicename or adding the device fails.
> Therefore I think you can drop this patch for the stable series.

Thanks for confirming this.

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-05-02 15:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-02 11:18 Patch "PCI: endpoint: Fix kernel panic after put_device()" has been added to the 4.16-stable tree Rolf Evers-Fischer
2018-05-02 15:38 ` Greg KH
2018-05-02 15:51   ` Rolf Evers-Fischer
2018-05-02 15:58     ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.