mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
mt7603: improve validation of rx frames
- discard packets that have no rx group 3 (signal/rate info missing) - discard packets marked as VHT (no hardware support) - discard packets with invalid HT rate values Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
+4
-3
@@ -486,9 +486,8 @@ mt7603_mac_fill_rx(struct mt7603_dev *dev, struct sk_buff *skb)
|
||||
case MT_PHY_TYPE_HT_GF:
|
||||
case MT_PHY_TYPE_HT:
|
||||
status->encoding = RX_ENC_HT;
|
||||
break;
|
||||
case MT_PHY_TYPE_VHT:
|
||||
status->encoding = RX_ENC_VHT;
|
||||
if (i > 15)
|
||||
return -EINVAL;
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
@@ -517,6 +516,8 @@ mt7603_mac_fill_rx(struct mt7603_dev *dev, struct sk_buff *skb)
|
||||
rxd += 6;
|
||||
if ((u8 *) rxd - skb->data >= skb->len)
|
||||
return -EINVAL;
|
||||
} else {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
skb_pull(skb, (u8 *) rxd - skb->data + 2 * remove_pad);
|
||||
|
||||
Reference in New Issue
Block a user