[3.8.y.z extended stable] Patch "sfc: check for NULL efx->ptp_data in efx_ptp_event" has been added to staging queue

Kamal Mostafa kamal at canonical.com
Wed Mar 26 19:48:42 UTC 2014


This is a note to let you know that I have just added a patch titled

    sfc: check for NULL efx->ptp_data in efx_ptp_event

to the linux-3.8.y-queue branch of the 3.8.y.z extended stable tree 
which can be found at:

 http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.8.y-queue

This patch is scheduled to be released in version 3.8.13.21.

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.8.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Kamal

------

>From c43ad6eaa2736171782241cf102baca1ff147633 Mon Sep 17 00:00:00 2001
From: Edward Cree <ecree at solarflare.com>
Date: Tue, 25 Feb 2014 13:17:59 +0000
Subject: sfc: check for NULL efx->ptp_data in efx_ptp_event

[ Upstream commit 8f355e5cee63c2c0c145d8206c4245d0189f47ff ]

If we receive a PTP event from the NIC when we haven't set up PTP state
in the driver, we attempt to read through a NULL pointer efx->ptp_data,
triggering a panic.

Signed-off-by: Edward Cree <ecree at solarflare.com>
Acked-by: Shradha Shah <sshah at solarflare.com>
Signed-off-by: David S. Miller <davem at davemloft.net>
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
---
 drivers/net/ethernet/sfc/ptp.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/ethernet/sfc/ptp.c b/drivers/net/ethernet/sfc/ptp.c
index 3f93624..53fd765 100644
--- a/drivers/net/ethernet/sfc/ptp.c
+++ b/drivers/net/ethernet/sfc/ptp.c
@@ -1311,6 +1311,13 @@ void efx_ptp_event(struct efx_nic *efx, efx_qword_t *ev)
 	struct efx_ptp_data *ptp = efx->ptp_data;
 	int code = EFX_QWORD_FIELD(*ev, MCDI_EVENT_CODE);

+	if (!ptp) {
+		if (net_ratelimit())
+			netif_warn(efx, drv, efx->net_dev,
+				   "Received PTP event but PTP not set up\n");
+		return;
+	}
+
 	if (!ptp->enabled)
 		return;

--
1.8.3.2





More information about the kernel-team mailing list