Thread (9 messages) 9 messages, 3 authors, 2021-09-29

Re: [PATCH] tpm: fix potential NULL pointer access in tpm_del_char_device()

From: Jason Gunthorpe <jgg@ziepe.ca>
Date: 2021-09-24 14:20:36
Also in: linux-integrity, lkml

On Fri, Sep 24, 2021 at 04:17:52PM +0200, Lino Sanfilippo wrote:
On 24.09.21 at 15:33, Jason Gunthorpe wrote:
quoted
On Fri, Sep 24, 2021 at 03:29:46PM +0200, Lino Sanfilippo wrote:
quoted
So this bug is triggered when the bcm2835 drivers shutdown() function is called since this
driver does something quite unusual: it unregisters the spi controller in its shutdown()
handler.
This seems wrong

Jason

Unregistering the SPI controller during shutdown is only a side-effect of calling
bcm2835_spi_remove() in the shutdown handler:

static void bcm2835_spi_shutdown(struct platform_device *pdev)
{
	int ret;

	ret = bcm2835_spi_remove(pdev);
	if (ret)
		dev_err(&pdev->dev, "failed to shutdown\n");
}
That's wrong, the shutdown handler is only supposed to make the HW
stop doing DMA and interrupts so we can have a clean transition to
kexec/etc

It should not be manipulating other state.

Jason
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help