diff options
author | David S. Miller <davem@davemloft.net> | 2006-11-22 01:17:41 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-11-22 01:17:41 +0100 |
commit | 4498c80d9c1ebdf42837be6a52ead35a2aa2b819 (patch) | |
tree | 38357ba0adae6b149abdd4d22c7137fc02e9f0c9 | |
parent | [XFRM]: nlmsg length not computed correctly in the presence of subpolicies (diff) | |
download | linux-4498c80d9c1ebdf42837be6a52ead35a2aa2b819.tar.xz linux-4498c80d9c1ebdf42837be6a52ead35a2aa2b819.zip |
[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>
-rw-r--r-- | net/bluetooth/hci_sock.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c index f26a9eb49945..711a085eca5b 100644 --- a/net/bluetooth/hci_sock.c +++ b/net/bluetooth/hci_sock.c @@ -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)) continue; - if (flt->opcode && ((evt == HCI_EV_CMD_COMPLETE && - flt->opcode != *(__u16 *)(skb->data + 3)) || - (evt == HCI_EV_CMD_STATUS && - flt->opcode != *(__u16 *)(skb->data + 4)))) + if (flt->opcode && + ((evt == HCI_EV_CMD_COMPLETE && + flt->opcode != + get_unaligned((__u16 *)(skb->data + 3))) || + (evt == HCI_EV_CMD_STATUS && + flt->opcode != + get_unaligned((__u16 *)(skb->data + 4))))) continue; } |