<feed xmlns='http://www.w3.org/2005/Atom'>
<title>wireguard-nt, branch master</title>
<subtitle>WireGuard implementation for NT kernel</subtitle>
<id>https://git.zx2c4.com/wireguard-nt/atom/?h=master</id>
<link rel='self' href='https://git.zx2c4.com/wireguard-nt/atom/?h=master'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-nt/'/>
<updated>2026-10-06T16:33:02Z</updated>
<entry>
<title>driver: noise: reject response consumption after intermediate initiation</title>
<updated>2026-10-06T16:33:02Z</updated>
<author>
<name>Jason A. Donenfeld</name>
<email>Jason@zx2c4.com</email>
</author>
<published>2026-10-06T16:29:47Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-nt/commit/?id=90433bd1aa35ff082b7b2ceb89b6451a4fadd2af'/>
<id>urn:sha1:90433bd1aa35ff082b7b2ceb89b6451a4fadd2af</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 MuAcquirePushLockExclusive(), A completes and then also a
handshake initiation that's already been queued up runs in thread C,
which itself takes that same MuAcquirePushLockExclusive(). The handshake
initiation creation succeeds, and sets the state back to
waiting-for-response, and calls MuReleasePushLockExclusive(), at which
point thread B resumes, because either its finished its calculations or
was finally allowed to acquire MuAcquirePushLockExclusive(). 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

MuAcquirePushLockShared()
 sA = Handshake-&gt;State
 RtlCopyMemory(cA, Handshake-&gt;crypto)
MuReleasePushLockShared()
if (sA != 1)
 goto fail
SlowCrypto(cA)
                                MuAcquirePushLockShared()
                                 sB = Handshake-&gt;State
                                 RtlCopyMemory(cB, Handshake-&gt;crypto)
                                MuReleasePushLockShared()
                                if (sB != 1)
                                 goto fail
                                SlowCrypto(cB)
MuAcquirePushLockExclusive()
 if (sA != Handshake-&gt;State)
  goto fail
 RtlCopyMemory(Handshake-&gt;crypto, cA)
 Handshake-&gt;State = 2
MuReleasePushLockExclusive()
MuAcquirePushLockExclusive()
 if (Handshake-&gt;State != 2)
  goto fail
 DeriveSession(Handshake-&gt;crypto)
MuReleasePushLockExclusive()
                                                                MuAcquirePushLockExclusive()
                                                                 SlowCrypto(Handshake-&gt;crypto)
                                                                 Handshake-&gt;State = 1
                                                                MuReleasePushLockExclusive()
                                MuAcquirePushLockExclusive()
                                 if (sB != Handshake-&gt;State)
                                   goto fail
                                 RtlCopyMemory(Handshake-&gt;crypto, cB)
                                 Handshake-&gt;State = 2
                                MuReleasePushLockExclusive()
                                MuAcquirePushLockExclusive()
                                 if (Handshake-&gt;State != 2)
                                  goto fail
                                 DeriveSession(Handshake-&gt;crypto)
                                MuReleasePushLockExclusive()

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.

Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
</content>
</entry>
<entry>
<title>driver: ioctl: reset IsDeviceRemoving on cancel-remove</title>
<updated>2026-07-20T13:39:58Z</updated>
<author>
<name>Jason A. Donenfeld</name>
<email>Jason@zx2c4.com</email>
</author>
<published>2026-05-14T07:20:55Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-nt/commit/?id=9ca153916cc4d6ed8c6728681c33148f0137b091'/>
<id>urn:sha1:9ca153916cc4d6ed8c6728681c33148f0137b091</id>
<content type='text'>
Otherwise a vetoed query-remove leaves the adapter permanently
inaccessible via ioctl, even though NDIS keeps the miniport alive and
operational.

Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
</content>
</entry>
<entry>
<title>api: rundll32: manage replies from worker process better</title>
<updated>2026-07-20T13:39:58Z</updated>
<author>
<name>Jason A. Donenfeld</name>
<email>Jason@zx2c4.com</email>
</author>
<published>2026-05-14T07:21:07Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-nt/commit/?id=55669c7a1031f82b706f5e73cd5d726a08a5688c'/>
<id>urn:sha1:55669c7a1031f82b706f5e73cd5d726a08a5688c</id>
<content type='text'>
CommandLineToArgvW("") returns the calling executable's path with
Argc=1, so a silent worker crash would be parsed as a path through
wcstoul, yielding either bogus error codes or, on UNC paths, a
silent ERROR_SUCCESS. Also deal with a zero sized response buffer, and
the case when the response fills the buffer precisely.

Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
</content>
</entry>
<entry>
<title>api: adapter: pin the module across background orphan cleanup</title>
<updated>2026-07-14T14:31:53Z</updated>
<author>
<name>Jason A. Donenfeld</name>
<email>Jason@zx2c4.com</email>
</author>
<published>2026-07-13T21:43:44Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-nt/commit/?id=c04fced8680812c232364e03421cc8fa128f27c1'/>
<id>urn:sha1:c04fced8680812c232364e03421cc8fa128f27c1</id>
<content type='text'>
AdapterCleanupOrphanedDevices(TRUE) is called from DllMain's
DLL_PROCESS_ATTACH and queues CleanupOrphanedDevices onto a thread-pool
thread, where it runs long SetupAPI/CM operations and blocks on the
namespace mutexes. Pin the module before this happens, so that it can't
be unloaded while working.

Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
</content>
</entry>
<entry>
<title>api: cleanup phantom devices added by windows updates</title>
<updated>2026-07-14T14:26:52Z</updated>
<author>
<name>Jason A. Donenfeld</name>
<email>Jason@zx2c4.com</email>
</author>
<published>2026-05-11T21:19:49Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-nt/commit/?id=b0d305a1865c9b23fa677d9ddeb564a60d315973'/>
<id>urn:sha1:b0d305a1865c9b23fa677d9ddeb564a60d315973</id>
<content type='text'>
When Windows does major updates, it walks the driver store and manually
installs drivers into the ROOT namespace. This is a problem since we use
the SWD namespace. Since these nodes are never accounted for, they live
on and prevent the driver from ever being unloaded or upgraded.

Fix this by walking through the ROOT namespace and removing these
phantom drivers.

Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
</content>
</entry>
<entry>
<title>version: bump</title>
<updated>2026-05-07T12:17:00Z</updated>
<author>
<name>Jason A. Donenfeld</name>
<email>Jason@zx2c4.com</email>
</author>
<published>2026-05-06T15:14:18Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-nt/commit/?id=fef7bc4377a4f49ffa7c30841b48808fda578cad'/>
<id>urn:sha1:fef7bc4377a4f49ffa7c30841b48808fda578cad</id>
<content type='text'>
Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
</content>
</entry>
<entry>
<title>driver: nsi: forward IRPs instead of failing</title>
<updated>2026-05-07T12:17:00Z</updated>
<author>
<name>Jason A. Donenfeld</name>
<email>Jason@zx2c4.com</email>
</author>
<published>2026-05-06T15:27:56Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-nt/commit/?id=a24b243b7f188500d55eeabfbce128ec54d0668d'/>
<id>urn:sha1:a24b243b7f188500d55eeabfbce128ec54d0668d</id>
<content type='text'>
We always have a file reference to get the proper nsi device object, so
rather than failing, in most cases, we can properly service these
requests.

Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
</content>
</entry>
<entry>
<title>driver: nsi: compare FilterDevice pointers under rundown protection</title>
<updated>2026-05-07T12:17:00Z</updated>
<author>
<name>Jason A. Donenfeld</name>
<email>Jason@zx2c4.com</email>
</author>
<published>2026-05-06T15:03:07Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-nt/commit/?id=9c4f8a2fb508dc31cf34357156073dc801b595e7'/>
<id>urn:sha1:9c4f8a2fb508dc31cf34357156073dc801b595e7</id>
<content type='text'>
And also gate the PriorDispatch on the presence of an extension, which
NDIS always has.

Reported-by: Brian Diff &lt;bdiff7311@gmail.com&gt;
Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
</content>
</entry>
<entry>
<title>driver: nsi: re-initialize rundown protection atomically</title>
<updated>2026-05-07T12:17:00Z</updated>
<author>
<name>Jason A. Donenfeld</name>
<email>Jason@zx2c4.com</email>
</author>
<published>2026-05-06T14:07:51Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-nt/commit/?id=0aaa86579140d5225f288cf557c78e18da5da44c'/>
<id>urn:sha1:0aaa86579140d5225f288cf557c78e18da5da44c</id>
<content type='text'>
Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
</content>
</entry>
<entry>
<title>driver: noise: remove unused StaticPrivate variable</title>
<updated>2026-04-29T01:01:39Z</updated>
<author>
<name>Jason A. Donenfeld</name>
<email>Jason@zx2c4.com</email>
</author>
<published>2026-04-29T01:00:03Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-nt/commit/?id=7bb6cfc73ebfaa502b3016278e9ce0bb79548530'/>
<id>urn:sha1:7bb6cfc73ebfaa502b3016278e9ce0bb79548530</id>
<content type='text'>
The stack version of this is never used, because it's long-lived, and so
we always read it out of the peer struct.

Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
</content>
</entry>
</feed>
