Re: WireGuard patchset for OpenBSD, rev. 2

2020-05-28 Thread Claudio Jeker
On Thu, May 28, 2020 at 01:07:40PM +0200, Martin Pieuchot wrote: > On 27/05/20(Wed) 20:18, Matt Dunwoodie wrote: > > On Wed, 27 May 2020 09:34:53 +0200 > > Martin Pieuchot wrote: > > > Regarding the kernel, I'd suggest you use "#if NWG > 0" like it is > > > done for other pseudo-drives with

Re: WireGuard patchset for OpenBSD, rev. 2

2020-05-28 Thread Martin Pieuchot
On 27/05/20(Wed) 20:18, Matt Dunwoodie wrote: > On Wed, 27 May 2020 09:34:53 +0200 > Martin Pieuchot wrote: > > Regarding the kernel, I'd suggest you use "#if NWG > 0" like it is > > done for other pseudo-drives with 'needs-flag'. > > For the most part there is no significant changes to other

Re: WireGuard patchset for OpenBSD, rev. 2

2020-05-28 Thread Otto Moerbeek
On Thu, May 28, 2020 at 01:21:21AM -0600, Jason A. Donenfeld wrote: > On Thu, May 28, 2020 at 1:19 AM Otto Moerbeek wrote: > > Of course.., I was running it from a !wxallowed mount. BTW, qemu is in > > packages, no need to build it yourself. > > Sure, but now I've been somewhat nerd sniped and

Re: WireGuard patchset for OpenBSD, rev. 2

2020-05-28 Thread Jason A. Donenfeld
On Thu, May 28, 2020 at 1:19 AM Otto Moerbeek wrote: > Of course.., I was running it from a !wxallowed mount. BTW, qemu is in > packages, no need to build it yourself. Sure, but now I've been somewhat nerd sniped and am playing with this fcode forth implementation in qemu :-P. I wonder if

Re: WireGuard patchset for OpenBSD, rev. 2

2020-05-28 Thread Otto Moerbeek
On Thu, May 28, 2020 at 01:05:59AM -0600, Jason A. Donenfeld wrote: > On Thu, May 28, 2020 at 12:15 AM Otto Moerbeek wrote: > > > > On Wed, May 27, 2020 at 11:28:09PM -0600, Jason A. Donenfeld wrote: > > > > > Hi Otto, > > > > > > On Wed, May 27, 2020 at 4:07 AM Otto Moerbeek wrote: > > > >

Re: WireGuard patchset for OpenBSD, rev. 2

2020-05-28 Thread Jason A. Donenfeld
On Thu, May 28, 2020 at 12:15 AM Otto Moerbeek wrote: > > On Wed, May 27, 2020 at 11:28:09PM -0600, Jason A. Donenfeld wrote: > > > Hi Otto, > > > > On Wed, May 27, 2020 at 4:07 AM Otto Moerbeek wrote: > > > Although I'm not terribly interested in bugs that are only seen (s0 > > > far) using

Re: WireGuard patchset for OpenBSD, rev. 2

2020-05-28 Thread Otto Moerbeek
On Wed, May 27, 2020 at 11:28:09PM -0600, Jason A. Donenfeld wrote: > Hi Otto, > > On Wed, May 27, 2020 at 4:07 AM Otto Moerbeek wrote: > > Although I'm not terribly interested in bugs that are only seen (s0 > > far) using emulation, please send me the details on how you set up > > qemu. > >

Re: WireGuard patchset for OpenBSD, rev. 2

2020-05-27 Thread Jason A. Donenfeld
Hi Otto, On Wed, May 27, 2020 at 4:07 AM Otto Moerbeek wrote: > Although I'm not terribly interested in bugs that are only seen (s0 > far) using emulation, please send me the details on how you set up > qemu. Right, it could very well be a TCG bug. But maybe not. Here's how to get things

Re: WireGuard patchset for OpenBSD, rev. 2

2020-05-27 Thread Matt Dunwoodie
On Wed, 27 May 2020 01:43:34 -0600 "Jason A. Donenfeld" wrote: > On Wed, May 27, 2020 at 1:34 AM Martin Pieuchot > wrote: > > First question is, is it possible to use the wg(4) interface > > without a port? > > No, that is not how WireGuard works. For details on the actual > protocol

Re: WireGuard patchset for OpenBSD, rev. 2

2020-05-27 Thread Matt Dunwoodie
On Wed, 27 May 2020 09:34:53 +0200 Martin Pieuchot wrote: > Hello Matt, > > Thank you for your submission. Hi Martin, No worries, thank you for your feedback. This is something I want to help make happen and if I recall correctly, someone once said that if I wanted a new feature on OpenBSD

Re: WireGuard patchset for OpenBSD, rev. 2

2020-05-27 Thread Otto Moerbeek
On Wed, May 27, 2020 at 03:14:29AM -0600, Jason A. Donenfeld wrote: > One interesting quirk in doing this on qemu is that the 6.7 and > -current kernel both crash: > > Loading FCode image... > Loaded 6882 bytes > entry point is 0x4000 > Evaluating FCode... > OpenBSD IEEE 1275 Bootblock 2.0 >

Re: WireGuard patchset for OpenBSD, rev. 2

2020-05-27 Thread Jason A. Donenfeld
On Wed, May 27, 2020 at 2:12 AM Jason A. Donenfeld wrote: > > Hi again Klemens, > > On Tue, May 26, 2020 at 5:42 PM Jason A. Donenfeld wrote: > > > > On Tue, May 26, 2020 at 4:52 PM Jason A. Donenfeld wrote: > > > With regards to your crash, though, that's a bit more puzzling, and > > > I'd be

Re: WireGuard patchset for OpenBSD, rev. 2

2020-05-27 Thread Jason A. Donenfeld
Hey David, On Wed, May 27, 2020 at 2:26 AM David Gwynne wrote: > > On Tue, May 26, 2020 at 05:42:13PM -0600, Jason A. Donenfeld wrote: > > On Tue, May 26, 2020 at 4:52 PM Jason A. Donenfeld wrote: > > > With regards to your crash, though, that's a bit more puzzling, and > > > I'd be interested

Re: WireGuard patchset for OpenBSD, rev. 2

2020-05-27 Thread David Gwynne
On Tue, May 26, 2020 at 05:42:13PM -0600, Jason A. Donenfeld wrote: > On Tue, May 26, 2020 at 4:52 PM Jason A. Donenfeld wrote: > > With regards to your crash, though, that's a bit more puzzling, and > > I'd be interested to learn more details. Because these structs are > > already naturally

Re: WireGuard patchset for OpenBSD, rev. 2

2020-05-27 Thread Jason A. Donenfeld
Hi again Klemens, On Tue, May 26, 2020 at 5:42 PM Jason A. Donenfeld wrote: > > On Tue, May 26, 2020 at 4:52 PM Jason A. Donenfeld wrote: > > With regards to your crash, though, that's a bit more puzzling, and > > I'd be interested to learn more details. Because these structs are > > already

Re: WireGuard patchset for OpenBSD, rev. 2

2020-05-27 Thread Matt Dunwoodie
On Tue, 26 May 2020 13:28:22 +0200 Tobias Heider wrote: > Hi Matt, > > just repeating what I commented yesterday for the new diff to make > sure it isn't overlooked. Thank you for repeating it, I didn't get around to addressing it before the new diff. > > +int > > +wg_ioctl_get(struct

Re: WireGuard patchset for OpenBSD, rev. 2

2020-05-27 Thread Jason A. Donenfeld
Hi Martin, To answer a few but not all of your questions: On Wed, May 27, 2020 at 1:34 AM Martin Pieuchot wrote: > First question is, is it possible to use the wg(4) interface without a > port? No, that is not how WireGuard works. For details on the actual protocol particulars, please see

Re: WireGuard patchset for OpenBSD, rev. 2

2020-05-27 Thread Martin Pieuchot
Hello Matt, Thank you for your submission. On 26/05/20(Tue) 19:39, Matt Dunwoodie wrote: > After some feedback and comments, we've addressed the concerns, and > fixed a few things from our side too. Overall the structure is familiar > with no major changes, so any prior readings mostly carry

Re: WireGuard patchset for OpenBSD, rev. 2

2020-05-26 Thread Jason A. Donenfeld
On Tue, May 26, 2020 at 4:52 PM Jason A. Donenfeld wrote: > With regards to your crash, though, that's a bit more puzzling, and > I'd be interested to learn more details. Because these structs are > already naturally aligned, the __packed attribute, even with the odd > nesting Matt had prior,

Re: WireGuard patchset for OpenBSD, rev. 2

2020-05-26 Thread Jason A. Donenfeld
Hey Klemens, Theo, On Tue, May 26, 2020 at 2:38 PM Klemens Nanni wrote: > > On Tue, May 26, 2020 at 02:23:06PM -0600, Jason A. Donenfeld wrote: > > That's good news that it's working for you now, but I didn't change > > anything within the last 24 hours (you mentioned "yesterday") that > > would

Re: WireGuard patchset for OpenBSD, rev. 2

2020-05-26 Thread Jason A. Donenfeld
On Tue, May 26, 2020 at 2:33 PM Theo de Raadt wrote: > > Jason A. Donenfeld wrote: > > > Hey Klemens, > > > > On Tue, May 26, 2020 at 9:13 AM Klemens Nanni wrote: > > > I worked with the patches from the wireguard-openbsd repository after > > > version one of this diff on tech@ became a bit

Re: WireGuard patchset for OpenBSD, rev. 2

2020-05-26 Thread Theo de Raadt
Jason A. Donenfeld wrote: > Hey Klemens, > > On Tue, May 26, 2020 at 9:13 AM Klemens Nanni wrote: > > I worked with the patches from the wireguard-openbsd repository after > > version one of this diff on tech@ became a bit old. > > > > That was until yesterday; the kernel would panic due to

Re: WireGuard patchset for OpenBSD, rev. 2

2020-05-26 Thread Jason A. Donenfeld
Hey Klemens, On Tue, May 26, 2020 at 9:13 AM Klemens Nanni wrote: > I worked with the patches from the wireguard-openbsd repository after > version one of this diff on tech@ became a bit old. > > That was until yesterday; the kernel would panic due to memory > alignment issues in various spots,

Re: WireGuard patchset for OpenBSD, rev. 2

2020-05-26 Thread Jason A. Donenfeld
Hey Tobias, On Tue, May 26, 2020 at 5:28 AM Tobias Heider wrote: > > + if (((SIZE_MAX - size) / sizeof(struct wg_aip_io)) < sc->sc_aip_num) > > + goto error; > > I still think those two should return an error. 'goto error' is misleading as > it doesn't actually set ret != 0.

Re: WireGuard patchset for OpenBSD, rev. 2

2020-05-26 Thread Klemens Nanni
On Tue, May 26, 2020 at 08:09:48AM -0600, Theo de Raadt wrote: > I'll let you know who has sparc64 machines to help out: > > kn was the developer who saw the problem. jca is also adept > enough to look at this with you. I worked with the patches from the wireguard-openbsd repository after

Re: WireGuard patchset for OpenBSD, rev. 2

2020-05-26 Thread Theo de Raadt
I'll let you know who has sparc64 machines to help out: kn was the developer who saw the problem. jca is also adept enough to look at this with you.

Re: WireGuard patchset for OpenBSD, rev. 2

2020-05-26 Thread Tobias Heider
On Tue, May 26, 2020 at 07:39:01PM +1000, Matt Dunwoodie wrote: > Hi tech, > > After some feedback and comments, we've addressed the concerns, and > fixed a few things from our side too. Overall the structure is familiar > with no major changes, so any prior readings mostly carry over. > > This

Re: WireGuard patchset for OpenBSD, rev. 2

2020-05-26 Thread Jason A. Donenfeld
Hey tech@, A few things I thought I should add to our v2 revision: First, the improvements we've made in the last few weeks have been pretty substantial, and we've now got a much more faithful protocol implementation. I've been running this on a few high traffic servers, and I'll probably move