Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] wifi: mt76: fix USB copy source overreads
@ 2026-09-25 15:05 Jiale Yao
  2026-09-25 15:05 ` [PATCH 1/2] wifi: mt76: usb: fix source overread in mt76u_copy Jiale Yao
  2026-09-25 15:05 ` [PATCH 2/2] wifi: mt76: mt7615: usb: fix source overread in mt7663u_copy Jiale Yao
  0 siblings, 2 replies; 3+ messages in thread
From: Jiale Yao @ 2026-09-25 15:05 UTC (permalink / raw)
  To: Felix Fietkau, Lorenzo Bianconi, Ryder Lee, Shayne Chen,
	Sean Wang, Matthias Brugger, AngeloGioacchino Del Regno,
	Johan Hovold, Markus Theil, linux-wireless, linux-kernel,
	linux-arm-kernel, linux-mediatek
  Cc: Jiale Yao

The USB copy helpers round up the caller's length to four bytes and
then use the rounded length as the bound for memcpy() from the source
buffer. If the caller supplies a length that is not a multiple of four,
the final transfer reads one to three bytes past the source buffer.
The beacon write path can pass such an unaligned length.

The MMIO copy helpers already handle their unaligned tail through a
four-byte bounce buffer. Apply the same principle to the USB helpers:
keep the original length as the source-copy bound and zero the unused
bytes in the transmit buffer so that the register access width remains
four-byte aligned.

The two patches are independent and both apply to the same baseline:

  wifi: mt76: usb: fix source overread in mt76u_copy
  wifi: mt76: mt7615: usb: fix source overread in mt7663u_copy

Jiale Yao (2):
  wifi: mt76: usb: fix source overread in mt76u_copy
  wifi: mt76: mt7615: usb: fix source overread in mt7663u_copy

 drivers/net/wireless/mediatek/mt76/mt7615/usb.c | 17 ++++++++++++-----
 drivers/net/wireless/mediatek/mt76/usb.c        | 16 +++++++++++-----
 2 files changed, 23 insertions(+), 10 deletions(-)

-- 
2.34.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-09-25 15:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-25 15:05 [PATCH 0/2] wifi: mt76: fix USB copy source overreads Jiale Yao
2026-09-25 15:05 ` [PATCH 1/2] wifi: mt76: usb: fix source overread in mt76u_copy Jiale Yao
2026-09-25 15:05 ` [PATCH 2/2] wifi: mt76: mt7615: usb: fix source overread in mt7663u_copy Jiale Yao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox