aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2014-10-29 12:10:57 -0400
committerMarcel Holtmann <marcel@holtmann.org>2014-10-30 12:23:25 -0400
commitdaac197ca9966eca3a6b07600e579756a9a1d447 (patch)
tree212e2d7b9c528aec7db71480ad1b253cbd902929 /net
parent38130c31ef50de1999983601e448db2b1bc1057c (diff)
Bluetooth: 6lowpan: use after free in disconnect_devices()
This was accidentally changed from list_for_each_entry_safe() to list_for_each_entry() so now it has a use after free bug. I've changed it back. Fixes: 90305829635d ('Bluetooth: 6lowpan: Converting rwlocks to use RCU') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Jukka Rissanen <jukka.rissanen@linux.intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/6lowpan.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
index 7254bddaca2f..eef298d17452 100644
--- a/net/bluetooth/6lowpan.c
+++ b/net/bluetooth/6lowpan.c
@@ -1383,7 +1383,7 @@ static const struct file_operations lowpan_control_fops = {
1383 1383
1384static void disconnect_devices(void) 1384static void disconnect_devices(void)
1385{ 1385{
1386 struct lowpan_dev *entry, *new_dev; 1386 struct lowpan_dev *entry, *tmp, *new_dev;
1387 struct list_head devices; 1387 struct list_head devices;
1388 1388
1389 INIT_LIST_HEAD(&devices); 1389 INIT_LIST_HEAD(&devices);
@@ -1408,7 +1408,7 @@ static void disconnect_devices(void)
1408 1408
1409 rcu_read_unlock(); 1409 rcu_read_unlock();
1410 1410
1411 list_for_each_entry(entry, &devices, list) { 1411 list_for_each_entry_safe(entry, tmp, &devices, list) {
1412 ifdown(entry->netdev); 1412 ifdown(entry->netdev);
1413 BT_DBG("Unregistering netdev %s %p", 1413 BT_DBG("Unregistering netdev %s %p",
1414 entry->netdev->name, entry->netdev); 1414 entry->netdev->name, entry->netdev);