]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: usb: rtl8150: Fix frame padding
authorMichal Pecio <michal.pecio@gmail.com>
Tue, 14 Oct 2025 18:35:28 +0000 (20:35 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 16 Oct 2025 22:10:02 +0000 (15:10 -0700)
commit75cea9860aa6b2350d90a8d78fed114d27c7eca2
treea3e2055f4b8a43e448fdde2b012f1d9fe47b9da6
parent634ec1fc7982efeeeeed4a7688b0004827b43a21
net: usb: rtl8150: Fix frame padding

TX frames aren't padded and unknown memory is sent into the ether.

Theoretically, it isn't even guaranteed that the extra memory exists
and can be sent out, which could cause further problems. In practice,
I found that plenty of tailroom exists in the skb itself (in my test
with ping at least) and skb_padto() easily succeeds, so use it here.

In the event of -ENOMEM drop the frame like other drivers do.

The use of one more padding byte instead of a USB zero-length packet
is retained to avoid regression. I have a dodgy Etron xHCI controller
which doesn't seem to support sending ZLPs at all.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org
Signed-off-by: Michal Pecio <michal.pecio@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20251014203528.3f9783c4.michal.pecio@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/usb/rtl8150.c