File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -3771,18 +3771,22 @@ static void hci_tx_work(struct work_struct *work)
37713771/* ACL data packet */
37723772static void hci_acldata_packet (struct hci_dev * hdev , struct sk_buff * skb )
37733773{
3774- struct hci_acl_hdr * hdr = ( void * ) skb -> data ;
3774+ struct hci_acl_hdr * hdr ;
37753775 struct hci_conn * conn ;
37763776 __u16 handle , flags ;
37773777
3778- skb_pull (skb , HCI_ACL_HDR_SIZE );
3778+ hdr = skb_pull_data (skb , sizeof (* hdr ));
3779+ if (!hdr ) {
3780+ bt_dev_err (hdev , "ACL packet too small" );
3781+ goto drop ;
3782+ }
37793783
37803784 handle = __le16_to_cpu (hdr -> handle );
37813785 flags = hci_flags (handle );
37823786 handle = hci_handle (handle );
37833787
3784- BT_DBG ( "%s len %d handle 0x%4.4x flags 0x%4.4x", hdev -> name , skb -> len ,
3785- handle , flags );
3788+ bt_dev_dbg ( hdev , " len %d handle 0x%4.4x flags 0x%4.4x" , skb -> len ,
3789+ handle , flags );
37863790
37873791 hdev -> stat .acl_rx ++ ;
37883792
@@ -3803,6 +3807,7 @@ static void hci_acldata_packet(struct hci_dev *hdev, struct sk_buff *skb)
38033807 handle );
38043808 }
38053809
3810+ drop :
38063811 kfree_skb (skb );
38073812}
38083813
You can’t perform that action at this time.
0 commit comments