[BLUETOOTH]: Fix unaligned access in hci_send_to_sock.
The "u16 *" derefs of skb->data need to be wrapped inside of a get_unaligned(). Thanks to Gustavo Zacarias for the bug report. Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
785fd8b8a5
commit
4498c80d9c
|
@ -120,10 +120,13 @@ void hci_send_to_sock(struct hci_dev *hdev, struct sk_buff *skb)
|
||||||
if (!hci_test_bit(evt, &flt->event_mask))
|
if (!hci_test_bit(evt, &flt->event_mask))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (flt->opcode && ((evt == HCI_EV_CMD_COMPLETE &&
|
if (flt->opcode &&
|
||||||
flt->opcode != *(__u16 *)(skb->data + 3)) ||
|
((evt == HCI_EV_CMD_COMPLETE &&
|
||||||
(evt == HCI_EV_CMD_STATUS &&
|
flt->opcode !=
|
||||||
flt->opcode != *(__u16 *)(skb->data + 4))))
|
get_unaligned((__u16 *)(skb->data + 3))) ||
|
||||||
|
(evt == HCI_EV_CMD_STATUS &&
|
||||||
|
flt->opcode !=
|
||||||
|
get_unaligned((__u16 *)(skb->data + 4)))))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue