Commit daac197c authored by Dan Carpenter's avatar Dan Carpenter Committed by Marcel Holtmann

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: 90305829 ('Bluetooth: 6lowpan: Converting rwlocks to use RCU')
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarJukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 38130c31
...@@ -1383,7 +1383,7 @@ static const struct file_operations lowpan_control_fops = { ...@@ -1383,7 +1383,7 @@ static const struct file_operations lowpan_control_fops = {
static void disconnect_devices(void) static void disconnect_devices(void)
{ {
struct lowpan_dev *entry, *new_dev; struct lowpan_dev *entry, *tmp, *new_dev;
struct list_head devices; struct list_head devices;
INIT_LIST_HEAD(&devices); INIT_LIST_HEAD(&devices);
...@@ -1408,7 +1408,7 @@ static void disconnect_devices(void) ...@@ -1408,7 +1408,7 @@ static void disconnect_devices(void)
rcu_read_unlock(); rcu_read_unlock();
list_for_each_entry(entry, &devices, list) { list_for_each_entry_safe(entry, tmp, &devices, list) {
ifdown(entry->netdev); ifdown(entry->netdev);
BT_DBG("Unregistering netdev %s %p", BT_DBG("Unregistering netdev %s %p",
entry->netdev->name, entry->netdev); entry->netdev->name, entry->netdev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment