Commit 6bbd0d3
Bluetooth: hci_sync: fix set_local_name race condition
Function set_name_sync() uses hdev->dev_name field to send
HCI_OP_WRITE_LOCAL_NAME command, but copying from data to hdev->dev_name
is called after mgmt cmd was queued, so it is possible that function
set_name_sync() will read old name value.
This change adds name as a parameter for function hci_update_name_sync()
to avoid race condition.
Fixes: 6f6ff38 ("Bluetooth: hci_sync: Convert MGMT_OP_SET_LOCAL_NAME")
Signed-off-by: Pavel Shpakovskiy <[email protected]>
Reviewed-by: Paul Menzel <[email protected]>
Signed-off-by: Luiz Augusto von Dentz <[email protected]>1 parent 55b9551 commit 6bbd0d3
File tree
3 files changed
+8
-5
lines changed- include/net/bluetooth
- net/bluetooth
3 files changed
+8
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3481 | 3481 | | |
3482 | 3482 | | |
3483 | 3483 | | |
3484 | | - | |
| 3484 | + | |
3485 | 3485 | | |
3486 | 3486 | | |
3487 | 3487 | | |
3488 | 3488 | | |
3489 | 3489 | | |
3490 | | - | |
| 3490 | + | |
3491 | 3491 | | |
3492 | 3492 | | |
3493 | 3493 | | |
| |||
3540 | 3540 | | |
3541 | 3541 | | |
3542 | 3542 | | |
3543 | | - | |
| 3543 | + | |
3544 | 3544 | | |
3545 | 3545 | | |
3546 | 3546 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3892 | 3892 | | |
3893 | 3893 | | |
3894 | 3894 | | |
| 3895 | + | |
| 3896 | + | |
| 3897 | + | |
3895 | 3898 | | |
3896 | | - | |
| 3899 | + | |
3897 | 3900 | | |
3898 | 3901 | | |
3899 | 3902 | | |
| |||
0 commit comments