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:
Felix Fietkau
2018-04-13 10:38:35 +02:00
parent 9c52f36091
commit f36f3083ec
+4 -3
View File
@@ -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);