forked from torvalds/linux
Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Bluetooth: hci_sock: Fix calling lock_sock when handling HCI_DEV_UNREG
This removes the reference of hci_dev to hci_pinfo since the reference cannot prevent hdev to be freed hci_pinfo only keeps the index so in case the device is unregistered and freed hci_dev_get will return NULL thus prevent UAF. On top of it commands cases where copy_from_user needs to be used are now done without helding a reference to the hci_dev. Link: https://syzkaller.appspot.com/bug?extid=a5df189917e79d5e59c9 [1] Reported-by: syzbot <syzbot+a5df189917e79d5e59c9@syzkaller.appspotmail.com> Tested-by: syzbot <syzbot+a5df189917e79d5e59c9@syzkaller.appspotmail.com> Fixes: e305509 ("Bluetooth: use correct lock to prevent UAF of hdev object") Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
- Loading branch information
1 parent
3c755b4
commit a02b154e687ba3e82afdd263f84570b1ca185a8a
Showing
3 changed files
with
137 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.