linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Vyukov <dvyukov@google.com>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>
Cc: netdev <netdev@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	David Miller <davem@davemloft.net>,
	Greg KH <gregkh@linuxfoundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	"open list:HARDWARE RANDOM NUMBER GENERATOR CORE" 
	<linux-crypto@vger.kernel.org>
Subject: Re: [PATCH net-next v2] net: WireGuard secure network tunnel
Date: Wed, 18 Dec 2019 12:37:30 +0100	[thread overview]
Message-ID: <CACT4Y+Zssd6OZ2-U4kjw18mNthQyzPWZV_gkH3uATnSv1SVDfA@mail.gmail.com> (raw)
In-Reply-To: <CAHmME9o0AparjaaOSoZD14RAW8_AJTfKfcx3Y2ndDAPFNC-MeQ@mail.gmail.com>

On Wed, Dec 18, 2019 at 11:57 AM Jason A. Donenfeld <Jason@zx2c4.com> wrote:
>
> Hi Dmitry,
>
> On Wed, Dec 18, 2019 at 11:13 AM Dmitry Vyukov <dvyukov@google.com> wrote:
> > Does it really do "verbose debug log"? I only see it is used for
> > self-tests and debug checks:
>
> Yes, it does, via net_dbg and co. People with the Linux "dynamic
> debugging" feature turned also get the log by twiddling with some file
> at runtime.
>
> > In different contexts one may enable different sets of these.
> > In particular in fuzzing context one absolutely wants additional debug
> > checks, but not self tests and definitely no verbose logging. CI and
> > various manual scenarios will require different sets as well.
> > If this does verbose logging, we won't get debug checks as well during
> > fuzzing, which is unfortunate.
> > Can make sense splitting CONFIG_WIREGUARD_DEBUG into 2 or 3 separate
> > configs (that's what I see frequently). Unfortunately there is no
> > standard conventions for anything of this, so CIs will never find your
> > boot tests and fuzzing won't find the additional checks...
>
> I agree that it might make sense to split this up at some point, but
> for now I think it might be a bit overkill. Both the self-tests and
> debug tests are *very* light at the moment. Down the road if these
> become heavier, I think it'd probably be a good idea, but for the time
> being it'd mostly be more complexity for nothing.
>
> Another more interesting point, though, you wrote
> > and definitely no verbose logging.
>
> Actually with WireGuard, I think that's not the case. The WireGuard
> logging has been written with DoS in mind. You /should/ be able to
> safely run it on a production system exposed to the wild Internet, and
> while there will be some additional things in your dmesg, an attacker
> isn't supposed to be able to totally flood it without ratelimiting or
> inject malicious strings into it (such as ANSI escape sequence). In
> other words, I consider the logging to be fair game attack surface. If
> your fuzzer manages to craft some nasty sequence of packets that
> tricks some rate limiting logic and lets you litter all over dmesg
> totally unbounded, I'd consider that a real security bug worth
> stressing out about. So from the perspective of letting your fuzzers
> loose on WireGuard, I'd actually like to see this option kept on.

This is the case even with CONFIG_WIREGUARD_DEBUG turned on, right? Or without?

Well, it may be able to trigger unbounded printing, but that won't be
detected as a bug and won't be reported. To be reported it needs to
fall into a set of predefined bug cases (e.g. "BUG:" or "WARNING:" on
console). Unless of course it triggers total stall/hang. But I'm
afraid it will just dirty dmesg, make reading crashes harder and slow
down everything without benefit. O(1) output per test is generally not
OK in heavy stressing scenario, even if it's overall bounded and rate
limited.

  reply	other threads:[~2019-12-18 11:37 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-08 23:27 [PATCH net-next v2] net: WireGuard secure network tunnel Jason A. Donenfeld
2019-12-09  1:52 ` David Miller
2019-12-09 10:07   ` Jason A. Donenfeld
2019-12-18 10:12 ` Dmitry Vyukov
2019-12-18 10:57   ` Jason A. Donenfeld
2019-12-18 11:37     ` Dmitry Vyukov [this message]
2019-12-18 11:50       ` Jason A. Donenfeld
2019-12-19  9:35         ` Dmitry Vyukov
2019-12-19 10:07           ` Jason A. Donenfeld
2019-12-19 10:11             ` Jason A. Donenfeld
2019-12-19 10:49               ` Dmitry Vyukov
2019-12-19 10:53                 ` Jason A. Donenfeld
2019-12-19 11:18                   ` Dmitry Vyukov
2019-12-19 11:38                     ` Jason A. Donenfeld
2019-12-19 14:30                       ` Dmitry Vyukov
2019-12-19 10:42             ` Dmitry Vyukov
2019-12-19 10:50               ` Jason A. Donenfeld

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=CACT4Y+Zssd6OZ2-U4kjw18mNthQyzPWZV_gkH3uATnSv1SVDfA@mail.gmail.com \
    --to=dvyukov@google.com \
    --cc=Jason@zx2c4.com \
    --cc=davem@davemloft.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=torvalds@linux-foundation.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).