From: Dmitry Ilvokhin <d@ilvokhin.com>
To: "Jason A . Donenfeld" <Jason@zx2c4.com>
Cc: wireguard@lists.zx2c4.com
Subject: Re: [PATCH] wg-quick: darwin: fix set_dns() and del_dns() race
Date: Wed, 7 Oct 2026 10:21:42 +0000 [thread overview]
Message-ID: <asYdNuvLW2FG_3BK@shell.ilvokhin.com> (raw)
In-Reply-To: <20260930103041.102065-1-d@ilvokhin.com>
On Wed, Sep 30, 2026 at 10:30:41AM +0000, Dmitry Ilvokhin wrote:
> The monitor deamon restores the DNS servers by running del_dns() from
> its INT, TERM and EXIT trap. Every route event also schedules an ALRM 2
> seconds later, and the ALRM trap runs set_dns().
>
> If ALRM arrives during cleanup, set_dns() can run in the middle of
> del_dns(), and the DNS servers may not be restored after the WireGuard
> interface is removed.
>
> Ignore ALRM in cleanup signal handler to avoid this race.
>
> Signed-off-by: Dmitry Ilvokhin <d@ilvokhin.com>
> ---
> Resending the patch, since mailing list didn't accept it first time,
> because I was not a member of the list.
Hello Jason,
Any thoughts on the patch?
I applied this patch locally, tested it for a few weeks and never hit
the race again. I'd love to get the fix upstream.
next prev parent reply other threads:[~2026-10-07 10:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-30 10:30 [PATCH] wg-quick: darwin: fix set_dns() and del_dns() race Dmitry Ilvokhin
2026-10-07 10:21 ` Dmitry Ilvokhin [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-09-18 17:36 Dmitry Ilvokhin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=asYdNuvLW2FG_3BK@shell.ilvokhin.com \
--to=d@ilvokhin.com \
--cc=Jason@zx2c4.com \
--cc=wireguard@lists.zx2c4.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox