linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] Bluetooth: mgmt: Fix sending events with uninitialized data
@ 2012-08-22 19:33 Vinicius Costa Gomes
  2012-08-22 19:33 ` [PATCH 2/2] Bluetooth: Power the device up after a rfkill unblock Vinicius Costa Gomes
  0 siblings, 1 reply; 6+ messages in thread
From: Vinicius Costa Gomes @ 2012-08-22 19:33 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Vinicius Costa Gomes

In response to the Read Index List command, it is possible that
uninitialized data is sent to userspace because the way the number
of adapters is counted. This way we only count adapters that will
be included in the response.

Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
---
 net/bluetooth/mgmt.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 05d4b83..6219a39 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -333,6 +333,9 @@ static int read_index_list(struct sock *sk, struct hci_dev *hdev, void *data,
 
 	count = 0;
 	list_for_each_entry(d, &hci_dev_list, list) {
+		if (test_bit(HCI_SETUP, &d->dev_flags))
+			continue;
+
 		if (!mgmt_valid_hdev(d))
 			continue;
 
-- 
1.7.11.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-08-26  7:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-22 19:33 [PATCH 1/2] Bluetooth: mgmt: Fix sending events with uninitialized data Vinicius Costa Gomes
2012-08-22 19:33 ` [PATCH 2/2] Bluetooth: Power the device up after a rfkill unblock Vinicius Costa Gomes
2012-08-24 12:28   ` Johan Hedberg
2012-08-24 13:32     ` Vinicius Costa Gomes
2012-08-24 19:58     ` [PATCH] " Vinicius Costa Gomes
2012-08-26  7:28       ` Johan Hedberg

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).