* Patch "can: c_can_pci: fix null-pointer-deref in c_can_start() - set device pointer" has been added to the 4.4-stable tree
@ 2017-01-30 13:33 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-01-30 13:33 UTC (permalink / raw)
To: tolvupostur, gregkh, mkl; +Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
can: c_can_pci: fix null-pointer-deref in c_can_start() - set device pointer
to the 4.4-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:
can-c_can_pci-fix-null-pointer-deref-in-c_can_start-set-device-pointer.patch
and it can be found in the queue-4.4 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.
>From c97c52be78b8463ac5407f1cf1f22f8f6cf93a37 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Einar=20J=C3=B3n?= <tolvupostur@gmail.com>
Date: Fri, 12 Aug 2016 13:50:41 +0200
Subject: can: c_can_pci: fix null-pointer-deref in c_can_start() - set device pointer
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From: Einar Jón <tolvupostur@gmail.com>
commit c97c52be78b8463ac5407f1cf1f22f8f6cf93a37 upstream.
The priv->device pointer for c_can_pci is never set, but it is used
without a NULL check in c_can_start(). Setting it in c_can_pci_probe()
like c_can_plat_probe() prevents c_can_pci.ko from crashing, with and
without CONFIG_PM.
This might also cause the pm_runtime_*() functions in c_can.c to
actually be executed for c_can_pci devices - they are the only other
place where priv->device is used, but they all contain a null check.
Signed-off-by: Einar Jón <tolvupostur@gmail.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/can/c_can/c_can_pci.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/net/can/c_can/c_can_pci.c
+++ b/drivers/net/can/c_can/c_can_pci.c
@@ -161,6 +161,7 @@ static int c_can_pci_probe(struct pci_de
dev->irq = pdev->irq;
priv->base = addr;
+ priv->device = &pdev->dev;
if (!c_can_pci_data->freq) {
dev_err(&pdev->dev, "no clock frequency defined\n");
Patches currently in stable-queue which might be from tolvupostur@gmail.com are
queue-4.4/can-c_can_pci-fix-null-pointer-deref-in-c_can_start-set-device-pointer.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-01-30 13:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-30 13:33 Patch "can: c_can_pci: fix null-pointer-deref in c_can_start() - set device pointer" has been added to the 4.4-stable tree gregkh
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).