]> git.ipfire.org Git - thirdparty/linux.git/commit
wireguard: send: append trailer after expanding head
authorJason A. Donenfeld <Jason@zx2c4.com>
Fri, 29 May 2026 17:31:34 +0000 (19:31 +0200)
committerJakub Kicinski <kuba@kernel.org>
Fri, 29 May 2026 20:01:27 +0000 (13:01 -0700)
commitf75e3eb08fe31d30a9af6ed80cdd22e6772837e2
treef0fbbe0162be13360b5e09262b90a2fcf5d0389b
parent072aa0f5c3d8f11f3159037418ec45edce7440b8
wireguard: send: append trailer after expanding head

With how this is currently written, we add the trailer, zero it out, and
then add the header space on. If that header space requires a
reallocation + copy, the zeros in the trailer aren't copied, because the
skb len hasn't actually been yet expanded to cover that. Instead add the
padding at the end of the process rather than at the beginning.

Fixes: e7096c131e51 ("net: WireGuard secure network tunnel")
Cc: stable@vger.kernel.org
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Link: https://patch.msgid.link/20260529173134.3080773-2-Jason@zx2c4.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/wireguard/send.c