Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758361AbWK2WFE (ORCPT ); Wed, 29 Nov 2006 17:05:04 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758302AbWK2WEm (ORCPT ); Wed, 29 Nov 2006 17:04:42 -0500 Received: from 216-99-217-87.dsl.aracnet.com ([216.99.217.87]:6613 "EHLO sous-sol.org") by vger.kernel.org with ESMTP id S1758295AbWK2WEd (ORCPT ); Wed, 29 Nov 2006 17:04:33 -0500 Message-Id: <20061129220638.365194000@sous-sol.org> References: <20061129220111.137430000@sous-sol.org> User-Agent: quilt/0.45-1 Date: Wed, 29 Nov 2006 14:00:31 -0800 From: Chris Wright To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: Justin Forbes , Zwane Mwaikambo , "Theodore Ts'o" , Randy Dunlap , Dave Jones , Chuck Wolber , Chris Wedgwood , Michael Krufky , torvalds@osdl.org, akpm@osdl.org, alan@lxorguk.ukuu.org.uk, maks@sternwelten.at, "David S. Miller" Subject: [patch 20/23] BLUETOOTH: Fix unaligned access in hci_send_to_sock. Content-Disposition: inline; filename=bluetooth-fix-unaligned-access-in-hci_send_to_sock.patch Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1410 Lines: 44 -stable review patch. If anyone has any objections, please let us know. ------------------ From: David S. Miller 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 Signed-off-by: Chris Wright --- net/bluetooth/hci_sock.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) --- linux-2.6.18.4.orig/net/bluetooth/hci_sock.c +++ linux-2.6.18.4/net/bluetooth/hci_sock.c @@ -120,10 +120,13 @@ void hci_send_to_sock(struct hci_dev *hd 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; } -- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/