From: David Miller <davem@davemloft.net>
To: Jason@zx2c4.com
Cc: netdev@vger.kernel.org, edumazet@google.com
Subject: Re: [PATCH net 0/2] wireguard fixes for 5.9-rc5
Date: Wed, 09 Sep 2020 11:33:11 -0700 (PDT) [thread overview]
Message-ID: <20200909.113311.839581620512182853.davem@davemloft.net> (raw)
In-Reply-To: <20200909115815.522168-1-Jason@zx2c4.com>
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
Date: Wed, 9 Sep 2020 13:58:13 +0200
> Yesterday, Eric reported a race condition found by syzbot. This series
> contains two commits, one that fixes the direct issue, and another that
> addresses the more general issue, as a defense in depth.
>
> 1) The basic problem syzbot unearthed was that one particular mutation
> of handshake->entry was not protected by the handshake mutex like the
> other cases, so this patch basically just reorders a line to make
> sure the mutex is actually taken at the right point. Most of the work
> here went into making sure the race was fully understood and making a
> reproducer (which syzbot was unable to do itself, due to the rarity
> of the race).
>
> 2) Eric's initial suggestion for fixing this was taking a spinlock
> around the hash table replace function where the null ptr deref was
> happening. This doesn't address the main problem in the most precise
> possible way like (1) does, but it is a good suggestion for
> defense-in-depth, in case related issues come up in the future, and
> basically costs nothing from a performance perspective. I thought it
> aided in implementing a good general rule: all mutators of that hash
> table take the table lock. So that's part of this series as a
> companion.
>
> Both of these contain Fixes: tags and are good candidates for stable.
Series applied and queued up for -stable, thanks.
prev parent reply other threads:[~2020-09-09 18:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-09 11:58 [PATCH net 0/2] wireguard fixes for 5.9-rc5 Jason A. Donenfeld
2020-09-09 11:58 ` [PATCH net 1/2] wireguard: noise: take lock when removing handshake entry from table Jason A. Donenfeld
2020-09-09 11:58 ` [PATCH net 2/2] wireguard: peerlookup: take lock before checking hash in replace operation Jason A. Donenfeld
2020-09-09 18:33 ` David Miller [this message]
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=20200909.113311.839581620512182853.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=Jason@zx2c4.com \
--cc=edumazet@google.com \
--cc=netdev@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).