[3.16.y-ckt stable] Patch "Bluetooth: Fix crash in the Marvell driver initialization codepath" has been added to staging queue

Luis Henriques luis.henriques at canonical.com
Wed Dec 3 11:02:20 UTC 2014


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

    Bluetooth: Fix crash in the Marvell driver initialization codepath

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

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

This patch is scheduled to be released in version 3.16.7-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 3.16.y-ckt tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Luis

------

>From a7b256527e348c69530cabfcb2031d9fd74e4586 Mon Sep 17 00:00:00 2001
From: Anatol Pomozov <anatol.pomozov at gmail.com>
Date: Wed, 30 Jul 2014 15:57:03 -0700
Subject: Bluetooth: Fix crash in the Marvell driver initialization codepath

commit 8500d791c458ccbbb3e2d3fa9a0320ffd5729069 upstream.

btmrvl_add_card() function calls kthread_run that might return error
(e.g. if current thread is killed). If one tries to use the error
value as a pointer then invalid memory access oops happens.

Check kthread_run() return value, if it is an error then release resources
correctly.

TEST=boot computer with BT modules enabled. I see the error message that
BT device initialization failed. Now kernel does not crash. Hint: to enable
BT run 'rmmod btmrvl_sdio; modprobe btmrvl_sdio'

Signed-off-by: Anatol Pomozov <anatol.pomozov at gmail.com>
Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
 drivers/bluetooth/btmrvl_main.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/bluetooth/btmrvl_main.c b/drivers/bluetooth/btmrvl_main.c
index 3ecba5c979bd..ae0b48471ffc 100644
--- a/drivers/bluetooth/btmrvl_main.c
+++ b/drivers/bluetooth/btmrvl_main.c
@@ -667,12 +667,17 @@ struct btmrvl_private *btmrvl_add_card(void *card)
 	init_waitqueue_head(&priv->main_thread.wait_q);
 	priv->main_thread.task = kthread_run(btmrvl_service_main_thread,
 				&priv->main_thread, "btmrvl_main_service");
+	if (IS_ERR(priv->main_thread.task))
+		goto err_thread;

 	priv->btmrvl_dev.card = card;
 	priv->btmrvl_dev.tx_dnld_rdy = true;

 	return priv;

+err_thread:
+	btmrvl_free_adapter(priv);
+
 err_adapter:
 	kfree(priv);





More information about the kernel-team mailing list