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)
3771
3771
/* ACL data packet */
3772
3772
static void hci_acldata_packet (struct hci_dev * hdev , struct sk_buff * skb )
3773
3773
{
3774
- struct hci_acl_hdr * hdr = ( void * ) skb -> data ;
3774
+ struct hci_acl_hdr * hdr ;
3775
3775
struct hci_conn * conn ;
3776
3776
__u16 handle , flags ;
3777
3777
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
+ }
3779
3783
3780
3784
handle = __le16_to_cpu (hdr -> handle );
3781
3785
flags = hci_flags (handle );
3782
3786
handle = hci_handle (handle );
3783
3787
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 );
3786
3790
3787
3791
hdev -> stat .acl_rx ++ ;
3788
3792
@@ -3803,6 +3807,7 @@ static void hci_acldata_packet(struct hci_dev *hdev, struct sk_buff *skb)
3803
3807
handle );
3804
3808
}
3805
3809
3810
+ drop :
3806
3811
kfree_skb (skb );
3807
3812
}
3808
3813
You can’t perform that action at this time.
0 commit comments