[4.2.y-ckt stable] Patch "coresight: checking for NULL string in coresight_name_match()" has been added to the 4.2.y-ckt tree

Kamal Mostafa kamal at canonical.com
Wed Jan 27 00:10:08 UTC 2016


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

    coresight: checking for NULL string in coresight_name_match()

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

    http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-4.2.y-queue

This patch is scheduled to be released in version 4.2.8-ckt3.

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

For more information about the 4.2.y-ckt tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Kamal

---8<------------------------------------------------------------

>From 855d20822571d3411a144cce44197cb5599b1b1e Mon Sep 17 00:00:00 2001
From: Mathieu Poirier <mathieu.poirier at linaro.org>
Date: Thu, 17 Dec 2015 08:47:02 -0700
Subject: coresight: checking for NULL string in coresight_name_match()

commit fadf3a44e974b030e7145218ad1ab25e3ef91738 upstream.

Connection child names associated to ports can sometimes be NULL,
which is the case when booting a system on QEMU or when the Coresight
power domain isn't switched on.

This patch is adding a check to make sure a NULL string isn't fed
to strcmp(), something that avoid crashing the system.

Reported-by: Tyler Baker <tyler.baker at linaro.org>
Signed-off-by: Mathieu Poirier <mathieu.poirier at linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
---
 drivers/hwtracing/coresight/coresight.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwtracing/coresight/coresight.c b/drivers/hwtracing/coresight/coresight.c
index 894531d..046144f 100644
--- a/drivers/hwtracing/coresight/coresight.c
+++ b/drivers/hwtracing/coresight/coresight.c
@@ -543,7 +543,7 @@ static int coresight_name_match(struct device *dev, void *data)
 	to_match = data;
 	i_csdev = to_coresight_device(dev);

-	if (!strcmp(to_match, dev_name(&i_csdev->dev)))
+	if (to_match && !strcmp(to_match, dev_name(&i_csdev->dev)))
 		return 1;

 	return 0;
--
1.9.1





More information about the kernel-team mailing list