]> www.infradead.org Git - users/dwmw2/linux.git/commit
mt76: round up length on mt76_wr_copy
authorFelix Fietkau <nbd@nbd.name>
Mon, 1 Jul 2019 11:15:07 +0000 (13:15 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 5 Oct 2019 11:14:11 +0000 (13:14 +0200)
commite1ff89ad3ddede49fa80607ca5ec93ac7e3b6651
treed46a161e9072cc2aa48ce1cb95ec040d45d9acdc
parentd08bb3463d8fee8bfdbfc94a4037898825c0d4fe
mt76: round up length on mt76_wr_copy

commit 850e8f6fbd5d0003b0f1119d19a01c6fef1644e2 upstream.

When beacon length is not a multiple of 4, the beacon could be sent with
the last 1-3 bytes corrupted. The skb data is guaranteed to have enough
room for reading beyond the end, because it is always followed by
skb_shared_info, so rounding up is safe.
All other callers of mt76_wr_copy have multiple-of-4 length already.

Cc: stable@vger.kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/wireless/mediatek/mt76/mmio.c
drivers/net/wireless/mediatek/mt76/usb.c