Development discussion of WireGuard
 help / color / mirror / Atom feed
From: Kyle Evans <kevans@freebsd.org>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>
Cc: "WireGuard mailing list" <wireguard@lists.zx2c4.com>,
	"Bernhard Fröhlich" <decke@freebsd.org>,
	"Matt Dunwoodie" <ncon@noconroy.net>
Subject: Re: FreeBSD/wireguard-tools
Date: Tue, 9 Mar 2021 21:14:38 -0600	[thread overview]
Message-ID: <CACNAnaHR+Jmyiaq8UfVp_W=BOA0OZh-_Cn0Lqts+Xj0eN9KY_w@mail.gmail.com> (raw)
In-Reply-To: <CAHmME9pQGWUo=Q0ohXUkXapS7rZ1qbP+GFHkDDOD2hp5VSD+Pw@mail.gmail.com>

On Tue, Mar 9, 2021 at 3:23 PM Jason A. Donenfeld <Jason@zx2c4.com> wrote:
>
> Hi Kyle,
>
> Thanks for getting in touch. So far as I can tell, Matt Macy never
> finished either the port of wireguard-tools or the port of the actual
> kernel module from OpenBSD. I'm CCng Matt Dunwoodie, who has started
> working through the kernel module finding issues.

Ah, excellent!

> There was that awful error in 25519 (lack of scalar clamping) that somebody
> emailed me about a while ago. I don't know if that was ever fixed but I was quite
> surprised that got committed.

Indeed, that did get fixed.

> I got the impression from trying to work with Matt Macy that there wasn't too much
> interest in collaboration.  Your email is a very welcome change.

I can't speak much for the historical context here, but I do know that
we as a project
would benefit from collaboration if the end result is being able to
tap into the pre-existing
knowledge pool available here.

> I see the path forward for FreeBSD having a functional WireGuard
> implementation as something like this:
>
> 1. We work out kinks in the kernel module crypto and state machine. I
> need to sync with Matt Dunwoodie on his findings there. Maybe we can
> send patches ourselves, but maybe it'd be best to just have a
> screensharing call where we walk through this together, and after the
> call you can code/commit the problems that we identify from
> discussion? A similar undertaking has been on my todo list for a
> veryverylongtimenow for NetBSD, but that implementation is much, much
> further behind, while in contrast I think with FreeBSD we're a lot
> closer to things being where they should, and a lot of it will be a
> simple matter of syncing the OpenBSD code. So if you're willing to
> work with us, I think that's something we can get done together in a
> week or faster.
>
> 2. We fix/simplify the kernel module's IPC interface to just be a
> simple get/set, like every other implementation of WireGuard.
>
> 3. We write support for that IPC protocol as "ipc-freebsd.h" in
> wireguard-tools. Maybe we'll start with Macy's code, but he never
> incorporated the feedback I provided on that, so perhaps you'd like to
> start over. Whatever you please there is fine with me.
>

We discussed this out-of-band, but to re-iterate that for others that might
have tuned into the thread: I'm interested in maintaining the use of nvlists
for import/export to sidestep around some classes of ABI
concerns/considerations because we maintain two or three major branches
of FreeBSD (if you include the -CURRENT) that fixes/additions could be
backported to if we can manage backward compatibility. We're certainly open
to other possible changes here.

> 4. I relicense the tools as MIT. I've previously started on getting
> this done, and the only blocker was the embedded libmnl, which is LGPL
> and out of my control. But I think there are two reasons why this is
> not a real impediment: 1) I've been in touch with the author there,
> and I think he'll MIT it if poke again, and 2) that's only for Linux
> anyway, so you wouldn't need that file *at all* on FreeBSD.
>

This is excellent, thanks. As you guessed, we can just drop bits from
our vendor import that we won't be building, so no worries here as
long the pertinent parts can be cleanly considered MIT.

> Does that seem like a good plan? And if so, are you the right contact
> with whom to work on it? And what's the FreeBSD release schedule like?
> How long do we have to fix this?
>

This seems like a good plan, and I appreciate it. I'm more than happy
to play the ambassador role here, and hack on whatever I can be useful
with. The final build starts on the 26th and there's a strong
preference (or maybe it's even a hard policy) that there be no changes
between the last RC and the final build.

#1 above is, of course, the most critical step to accomplish prior to
the release. We could conceivably punt #2 to entirely post-release;
the ioctl interface isn't documented, so we could slap warnings in the
pertinent headers and ifconfig/ifwg.c to note that it's unstable and
will change between minor releases.

Punting it down the road a little bit entails a concession that stock
wg(8) will not be usable for FreeBSD 13.0, but we can work with decke@
to conjure up a patch against the port with our existing ipc-freebsd.h
with the limited functionality that it currently entails. I don't
think this is the worst concession we can make as long as it means
that we can focus on making the core functionality rock-solid and as
long as the situation is clearly advertised.

The ports model generally encourages problems with the port/pkg to go
through the port maintainer first, so theoretically decke@ would be
initially fielding any bug reports that arise from the suboptimal
situation in the ~yearish that 13.0 will hold tenure rather than you
seeing complaints from it upstream. The only folks building
wireguard-tools directly from upstream should be those wanting to work
against FreeBSD -CURRENT, but we can slap some __FreeBSD_version
checks in ipc-freebsd.h or somewhere to advise of the situation if
someone tries to use it against revisions that are incompatible with
the new UAPI.

Thanks,

Kyle Evans

      reply	other threads:[~2021-03-10  3:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-09 21:04 FreeBSD/wireguard-tools Kyle Evans
2021-03-09 21:23 ` FreeBSD/wireguard-tools Jason A. Donenfeld
2021-03-10  3:14   ` Kyle Evans [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='CACNAnaHR+Jmyiaq8UfVp_W=BOA0OZh-_Cn0Lqts+Xj0eN9KY_w@mail.gmail.com' \
    --to=kevans@freebsd.org \
    --cc=Jason@zx2c4.com \
    --cc=decke@freebsd.org \
    --cc=ncon@noconroy.net \
    --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;
as well as URLs for NNTP newsgroup(s).