]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Bluetooth: btintel: Fix null ptr deref in btintel_read_version
authorEdward Adam Davis <eadavis@qq.com>
Thu, 18 Jan 2024 04:40:34 +0000 (12:40 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 13 Apr 2024 10:59:44 +0000 (12:59 +0200)
[ Upstream commit b79e040910101b020931ba0c9a6b77e81ab7f645 ]

If hci_cmd_sync_complete() is triggered and skb is NULL, then
hdev->req_skb is NULL, which will cause this issue.

Reported-and-tested-by: syzbot+830d9e3fa61968246abd@syzkaller.appspotmail.com
Signed-off-by: Edward Adam Davis <eadavis@qq.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/bluetooth/btintel.c

index 88ce5f0ffc4babd74a8004cd9f9efc469b37d036..e1daf6ebd3ada00fd3840795408e963474d151a8 100644 (file)
@@ -344,7 +344,7 @@ int btintel_read_version(struct hci_dev *hdev, struct intel_version *ver)
        struct sk_buff *skb;
 
        skb = __hci_cmd_sync(hdev, 0xfc05, 0, NULL, HCI_CMD_TIMEOUT);
-       if (IS_ERR(skb)) {
+       if (IS_ERR_OR_NULL(skb)) {
                bt_dev_err(hdev, "Reading Intel version information failed (%ld)",
                           PTR_ERR(skb));
                return PTR_ERR(skb);