Skip to contentSkip to conversation

net: bluetooth: hci_core: Use list_for_each_entry_rcu() to traverse RCU list in RCU read-side CS

PATCH In review [email protected] 2 participants 2 messages Feb 25, 2020 – Feb 28, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: bluetooth: hci_core: Use list_for_each_entry_rcu() to traverse RCU list in RCU read-side CS

From: Madhuparna Bhowmik <[email protected]>

In function hci_is_blocked_key() RCU list is traversed with list_for_each_entry() in RCU read-side CS.
Use list_for_each_entry_rcu() instead.

---
 net/bluetooth/hci_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/bluetooth/hci_core.c +1 -1
index 8ddd1bea02be..4e6d61a95b20 100644
@@ -2327,7 +2327,7 @@ bool hci_is_blocked_key(struct hci_dev *hdev, u8 type, u8 val[16])
 	struct blocked_key *b;
 
 	rcu_read_lock();
-	list_for_each_entry(b, &hdev->blocked_keys, list) {
+	list_for_each_entry_rcu(b, &hdev->blocked_keys, list) {
 		if (b->type == type && !memcmp(b->val, val, sizeof(b->val))) {
 			blocked = true;
 			break;
Signature · 6 lines
2.17.1

_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
maintainer
#1 lore raw

Hi Madhuparna,

Quoted 8 lines

In function hci_is_blocked_key() RCU list is traversed with list_for_each_entry() in RCU read-side CS.
Use list_for_each_entry_rcu() instead.

---
net/bluetooth/hci_core.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel