<feed xmlns='http://www.w3.org/2005/Atom'>
<title>wireguard-linux/drivers/net/wireguard, branch stable</title>
<subtitle>WireGuard for the Linux kernel</subtitle>
<id>https://git.zx2c4.com/wireguard-linux/atom/drivers/net/wireguard?h=stable</id>
<link rel='self' href='https://git.zx2c4.com/wireguard-linux/atom/drivers/net/wireguard?h=stable'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/'/>
<updated>2026-10-08T12:51:27Z</updated>
<entry>
<title>wireguard: noise: reject response consumption after intermediate initiation</title>
<updated>2026-10-08T12:51:27Z</updated>
<author>
<name>Jason A. Donenfeld</name>
<email>Jason@zx2c4.com</email>
</author>
<published>2026-10-08T12:50:26Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=2a73c9b2c0ca737696b1bacc7559fcaf619e302e'/>
<id>urn:sha1:2a73c9b2c0ca737696b1bacc7559fcaf619e302e</id>
<content type='text'>
Two threads begin processing the identical response message, received
twice. The first thread, A, runs. While it's running, the second one,
B, gets partway through, and during that slow calculation, or even while
blocking on down_write(), A completes and then also a handshake
initiation that's already been queued up runs in thread C, which itself
takes that same down_write(). The handshake initiation creation
succeeds, and sets the state back to waiting-for-response, and calls
up_write(), at which point thread B resumes, because either its finished
its calculations or was finally allowed to acquire down_write(). Thread
B then copies the state back to the peer, and begins a new session,
using that state, which is the same session as the one made in thread A.

Thread A			Thread B			Thread C

down_read()
 sA = handshake-&gt;state
 memcpy(cA, handshake-&gt;crypto)
up_read()
if (sA != 1)
 goto fail
slow_crypto(cA)
				down_read()
				 sB = handshake-&gt;state
				 memcpy(cB, handshake-&gt;crypto)
				up_read()
				if (sB != 1)
				 goto fail
				slow_crypto(cB)
down_write()
 if (sA != handshake-&gt;state)
  goto fail
 memcpy(handshake-&gt;crypto, cA)
 handshake-&gt;state = 2
up_write()
down_write()
 if (handshake-&gt;state != 2)
  goto fail
 derive_session(handshake-&gt;crypto)
up_write()
								down_write()
								 slow_crypto(handshake-&gt;crypto)
								 handshake-&gt;state = 1
								up_write()
				down_write()
				 if (sB != handshake-&gt;state)
				   goto fail
				 memcpy(handshake-&gt;crypto, cB)
				 handshake-&gt;state = 2
				up_write()
				down_write()
				 if (handshake-&gt;state != 2)
				  goto fail
				 derive_session(handshake-&gt;crypto)
				up_write()

This seems basically impossible to hit in a meaningful way in practice,
but ensure that it absolutely cannot happen by comparing the ephemeral
private key that's on the stack with the latest one that the peer's
handshake state has.

Cc: stable@vger.kernel.org
Fixes: e7096c131e51 ("net: WireGuard secure network tunnel")
Reported-by: Jérémy Jean &lt;Jeremy.Jean@oss.cyber.gouv.fr&gt;
Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
</content>
</entry>
<entry>
<title>wireguard: queueing: preserve tstamp_type when encapsulating packet</title>
<updated>2026-10-06T15:17:21Z</updated>
<author>
<name>Ramses de Norre</name>
<email>ramses@well-founded.dev</email>
</author>
<published>2026-08-27T11:52:56Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=b76619c9db7601a2da999822e4264790171e602a'/>
<id>urn:sha1:b76619c9db7601a2da999822e4264790171e602a</id>
<content type='text'>
Sending traffic through a wireguard tunnel on a host using the fq
qdisc fills the log with:

  fq: likely mono tstamp with tstamp_type 0

An skb carries a timestamp in skb-&gt;tstamp and, separately, a
skb-&gt;tstamp_type field recording which clock that timestamp came from.
The two have to agree.

When wireguard encapsulates a packet it calls wg_reset_packet(), which
clears the fields that must not leak from the inner packet into the
tunnel packet. It does so in two steps:

  skb_scrub_packet(skb, true);
  memset(&amp;skb-&gt;headers, 0, sizeof(skb-&gt;headers));

skb_scrub_packet() deliberately keeps skb-&gt;tstamp when it holds a
monotonic timestamp: that value is the time the packet is scheduled to
be sent, and the qdisc still needs it. The memset then zeroes
skb-&gt;tstamp_type, because that field sits inside the headers group
while skb-&gt;tstamp does not. The packet therefore leaves wireguard
carrying a monotonic timestamp labelled as a realtime one.

Nothing noticed until commit c4f796c4f16b ("net_sched: sch_fq: convert
skb-&gt;tstamp if not monotonic"): fq used to assume every timestamp was
monotonic. It now consults tstamp_type, spots the mismatch, warns, and
falls back to treating the value as monotonic. Pacing still ends up
correct, so the log spam is the actual problem.

Save tstamp_type before the memset and restore it when encapsulating,
next to the hash fields that are already carried over this way. When
decapsulating it stays zeroed, which is right: an incoming packet's
timestamp is a realtime receive timestamp.

Fixes: d98d58a00261 ("net: Set skb-&gt;mono_delivery_time and clear it after sch_handle_ingress()")
Signed-off-by: Ramses de Norre &lt;ramses@well-founded.dev&gt;
Reviewed-by: Toke Høiland-Jørgensen &lt;toke@kernel.org&gt;
Reviewed-by: Eric Dumazet &lt;edumazet@google.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
</content>
</entry>
<entry>
<title>wireguard: noise: remove unused variable</title>
<updated>2026-10-06T15:17:21Z</updated>
<author>
<name>Jason A. Donenfeld</name>
<email>Jason@zx2c4.com</email>
</author>
<published>2026-05-30T11:55:48Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=589fe5966dfb48494c6449f9c84fcca3b2e75875'/>
<id>urn:sha1:589fe5966dfb48494c6449f9c84fcca3b2e75875</id>
<content type='text'>
This is a harmless artifact from early pre-release wireguard
development. These days, static_private is read from a shared
data structure under a read lock directly, and it doesn't need to be
copied to the stack. So remove the unused variable.

Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
</content>
</entry>
<entry>
<title>net: Use helpers to get/set UDP len tree-wide</title>
<updated>2026-07-22T11:47:02Z</updated>
<author>
<name>Alice Mikityanska</name>
<email>alice@isovalent.com</email>
</author>
<published>2026-07-10T13:42:34Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=5329647dad1bdb512e36905d0ae6a817b64f7f52'/>
<id>urn:sha1:5329647dad1bdb512e36905d0ae6a817b64f7f52</id>
<content type='text'>
Since BIG TCP for UDP tunnels will start using len=0 in the UDP header
as an indicator of a GSO packet bigger than 65535 bytes, this commit
introduces the following getter and setters to use tree-wide, in order
to explicitly mark places where len=0 may be expected, and handle them
properly:

1. udp_set_len() sets uh-&gt;len to its real value if it's not bigger than
65535, and to 0 otherwise: to be used in GSO context with aggregated
packets.

2. udp_set_len_short() is to be used when the length is known to fit 16
bits. It WARNs when the caller tries to assign a bigger value if
CONFIG_DEBUG_NET=y.

3. udp_get_len_short() returns len in host byte order: to be used on the
RX side to deal with non-aggregated packets, or to access the raw value
of the len field.

4. udp_get_len() decodes uh-&gt;len set by udp_set_len(). It checks whether
the packet is GSO to guard from malformed packets.

At the moment udp_set_len() is not used, a following commit will start
using it after enabling len&gt;65535 for GSO.

Raw uh-&gt;len (in network byte order) is still accessed in a few places
for checksum calculation purposes, and to decode len=0 in udpv6_rcv for
jumbograms. udp_rcv and udpv6_rcv will be addressed by the commit that
starts using udp_set_len() to set UDP len=0 for BIG TCP packets in UDP
tunnels.

Signed-off-by: Alice Mikityanska &lt;alice@isovalent.com&gt;
Reviewed-by: Willem de Bruijn &lt;willemb@google.com&gt;
Acked-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
Link: https://patch.msgid.link/20260710134242.216538-2-alice.kernel@fastmail.im
Reviewed-by: Nikolay Aleksandrov &lt;razor@blackwall.org&gt;
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net</title>
<updated>2026-06-01T11:42:12Z</updated>
<author>
<name>Paolo Abeni</name>
<email>pabeni@redhat.com</email>
</author>
<published>2026-06-01T11:35:51Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=c2c0486c56800ce276e79c40a6e576ffd672f2a9'/>
<id>urn:sha1:c2c0486c56800ce276e79c40a6e576ffd672f2a9</id>
<content type='text'>
Conflicts:

drivers/net/ethernet/microsoft/mana/mana_en.c:
  17bfe0a8c014e ("net: mana: Add NULL guards in teardown path to prevent panic on attach failure")
  d07efe5a6e641 ("net: mana: Use per-queue allocation for tx_qp to reduce allocation size")

Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
</content>
</entry>
<entry>
<title>wireguard: send: append trailer after expanding head</title>
<updated>2026-05-29T20:01:27Z</updated>
<author>
<name>Jason A. Donenfeld</name>
<email>Jason@zx2c4.com</email>
</author>
<published>2026-05-29T17:31:34Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=f75e3eb08fe31d30a9af6ed80cdd22e6772837e2'/>
<id>urn:sha1:f75e3eb08fe31d30a9af6ed80cdd22e6772837e2</id>
<content type='text'>
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 &lt;Jason@zx2c4.com&gt;
Link: https://patch.msgid.link/20260529173134.3080773-2-Jason@zx2c4.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>udp_tunnel: Pass struct sock to setup_udp_tunnel_sock().</title>
<updated>2026-05-06T00:47:04Z</updated>
<author>
<name>Kuniyuki Iwashima</name>
<email>kuniyu@google.com</email>
</author>
<published>2026-05-02T03:12:55Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=2cba193628fe523cee6dd61938db2c4563ce15a9'/>
<id>urn:sha1:2cba193628fe523cee6dd61938db2c4563ce15a9</id>
<content type='text'>
None of the udp_tunnel users need struct socket in their
fast paths; it is only used for tunnel setup / teardown.

Even setup_udp_tunnel_sock() does not need struct socket.

Let's change setup_udp_tunnel_sock() to take struct sock
instead of struct socket.

Signed-off-by: Kuniyuki Iwashima &lt;kuniyu@google.com&gt;
Link: https://patch.msgid.link/20260502031401.3557229-3-kuniyu@google.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>udp_tunnel: Pass struct sock to udp_tunnel_sock_release().</title>
<updated>2026-05-06T00:47:03Z</updated>
<author>
<name>Kuniyuki Iwashima</name>
<email>kuniyu@google.com</email>
</author>
<published>2026-05-02T03:12:54Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=944bfc1b1c6fe9417668006aae7124886bcca038'/>
<id>urn:sha1:944bfc1b1c6fe9417668006aae7124886bcca038</id>
<content type='text'>
None of the udp_tunnel users need struct socket in their
fast paths; it is only used for tunnel setup / teardown.

While the UDP tunnel interface accepts struct socket, this
encourages users to store the pointer unnecessarily.  This
leads to extra dereferences when accessing struct sock fields
(e.g., sk-&gt;sk_user_data instead of sock-&gt;sk-&gt;sk_user_data).

Furthermore, these dereferences necessitate synchronize_rcu()
in udp_tunnel_sock_release() to protect the fast paths from
sock_orphan() setting sk-&gt;sk_socket to NULL.

This overhead can be avoided if users store the struct sock
pointer directly in their private structures.

As a prep, let's change udp_tunnel_sock_release() to take
struct sock instead of struct socket.

Signed-off-by: Kuniyuki Iwashima &lt;kuniyu@google.com&gt;
Link: https://patch.msgid.link/20260502031401.3557229-2-kuniyu@google.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>wireguard: device: use exit_rtnl callback instead of manual rtnl_lock in pre_exit</title>
<updated>2026-04-14T18:48:04Z</updated>
<author>
<name>Shardul Bankar</name>
<email>shardul.b@mpiricsoftware.com</email>
</author>
<published>2026-04-14T15:39:44Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=60a25ef8dacb3566b1a8c4de00572a498e2a3bf9'/>
<id>urn:sha1:60a25ef8dacb3566b1a8c4de00572a498e2a3bf9</id>
<content type='text'>
wg_netns_pre_exit() manually acquires rtnl_lock() inside the
pernet .pre_exit callback.  This causes a hung task when another
thread holds rtnl_mutex - the cleanup_net workqueue (or the
setup_net failure rollback path) blocks indefinitely in
wg_netns_pre_exit() waiting to acquire the lock.

Convert to .exit_rtnl, introduced in commit 7a60d91c690b ("net:
Add -&gt;exit_rtnl() hook to struct pernet_operations."), where the
framework already holds RTNL and batches all callbacks under a
single rtnl_lock()/rtnl_unlock() pair, eliminating the contention
window.

The rcu_assign_pointer(wg-&gt;creating_net, NULL) is safe to move
from .pre_exit to .exit_rtnl (which runs after synchronize_rcu())
because all RCU readers of creating_net either use maybe_get_net()
- which returns NULL for a dying namespace with zero refcount - or
access net-&gt;user_ns which remains valid throughout the entire
ops_undo_list sequence.

Reported-by: syzbot+f2fbf7478a35a94c8b7c@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?id=cb64c22a492202ca929e18262fdb8cb89e635c70
Signed-off-by: Shardul Bankar &lt;shardul.b@mpiricsoftware.com&gt;
[ Jason: added __net_exit and __read_mostly annotations that were missing. ]
Fixes: 900575aa33a3 ("wireguard: device: avoid circular netns references")
Cc: stable@vger.kernel.org
Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
Link: https://patch.msgid.link/20260414153944.2742252-5-Jason@zx2c4.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>wireguard: allowedips: remove redundant space</title>
<updated>2026-04-14T18:48:04Z</updated>
<author>
<name>Jason A. Donenfeld</name>
<email>Jason@zx2c4.com</email>
</author>
<published>2026-04-14T15:39:43Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=f364db381c9d38c96de3148ac584f859c550fad5'/>
<id>urn:sha1:f364db381c9d38c96de3148ac584f859c550fad5</id>
<content type='text'>
Not a contentful commit, but amusingly found when porting ba3d7b93 to
Windows.

Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
Link: https://patch.msgid.link/20260414153944.2742252-4-Jason@zx2c4.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
</feed>
