mt76: mt7603: fix input validation issues for powersave-filtered frames
authorFelix Fietkau <nbd@nbd.name>
Sat, 21 Dec 2019 15:46:53 +0000 (16:46 +0100)
committerFelix Fietkau <nbd@nbd.name>
Fri, 14 Feb 2020 09:06:02 +0000 (10:06 +0100)
commitd55aa5e17461b8b423adae376978032c4a10a1d8
tree3aa77a013e5317f84601636b6117d0c3adc8f1c2
parentc99dc3c1524de875226528995abbb0294303bd6c
mt76: mt7603: fix input validation issues for powersave-filtered frames

Before extracting the tid out of the packet, check if it was qos-data.
Only accept tid values 0-7
Also, avoid accepting the hardware queue as skb queue mapping, it could
lead to an overrun. Instead, derive the hardware queue from the tid number,
in order to avoid issues with packets being filtered multiple times.
This also fixes a mismatch between hardware and software queue indexes.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7603/dma.c