random toeplitz seeds

2020-06-25 Thread Theo Buehler
This adds an stoeplitz_random_seed() function that generates a random Toeplitz key seed with an invertible matrix T. This is necessary and sufficient for the hash to spread out over all 65536 possible values. While it is clear from T * (-1) == 0 that seeds with parity 0 are bad, I don't have a

[PATCH] fast conditional console scrolling

2020-06-25 Thread johnc
This causes the write-only framebuffer console to only redraw the chars that differ between the start and end positions. 'time ls -R /usr/src/sys' is 3x faster with this, because most of the characters stay the same after a scroll. If this looks good, I can do the same thing for clear rows and

Re: userland clock_gettime proof of concept

2020-06-25 Thread George Koehler
On Mon, 22 Jun 2020 19:12:22 +0300 Paul Irofti wrote: > New iteration: > > - ps_timekeep should not coredump, pointed by deraadt@ > - set ps_timekeep to 0 before user uvm_map for randomization > - map timekeep before fixup. confirmed by naddy@ that it fixes NULL init > - initialize va.

Re: Destructive Install Process (fdisk)

2020-06-25 Thread Solene Rapenne
On Thu, 25 Jun 2020 19:27:22 -0400 David Blevins : > OpenBSD Community, > > I've been experimenting with the OpenBSD 6.7 install process (though > this "issue" is likely present in earlier version) and have noticed > that the fdisk program in the installation program will destructively > edit

Re: pipex(4): use reference counters for `ifnet'

2020-06-25 Thread Vitaliy Makkoveev
> On 25 Jun 2020, at 20:13, Christiano F. Haesbaert > wrote: > > You can. > > The idea is that ifindex is always monotonically increased, so to actually > get a new interface you would have to have "overflowed" 65k interfaces, > which is unreal. > > So if your interface is gone, you can be

Re: ffs(3): libc arch versions, regress

2020-06-25 Thread Christian Weisgerber
Trying again, this time with powerpc64 added: This adds the optimized ffs(3) versions on aarch64, powerpc, and powerpc64 to libc. Also add a brief regression test. Index: lib/libc/arch/aarch64/string/Makefile.inc === RCS file:

Re: pipex(4): use reference counters for `ifnet'

2020-06-25 Thread Vitaliy Makkoveev
Updated diff. OpenBSD uses 16 bit counter for allocate interface indexes. So we can't store index in session and be sure if_get(9) returned `ifnet' is our original `ifnet'. Now each pipex(4) session has it's own reference to `ifnet'. Also pppoe related sessions has the reference to it's

Re: Destructive Install Process (fdisk)

2020-06-25 Thread David Blevins
List, Apologies, I left HTML mode enabled on my web client. I understand that a Linux dmesg is probably not very useful. I can provide a different set of system information (or an OpenBSD dmesg from an MBR boot) but I'm not sure what set of information would be most useful in determining my issue

ssh-keygen(1): -a is missing in SYNOPSIS and small wording change

2020-06-25 Thread Solene Rapenne
I found that ssh-keygen(1) missed mention of -a flag in SYNOPSIS. The following patch adds mention to [-a rounds] with default (no flag), -p, -c, -K and -A All the functions triggered by these flags use the rounds variable defined with -a parameter (default 0) I also propose a small wording

Re: Destructive Install Process (fdisk)

2020-06-25 Thread David Blevins
> Personally, I don't think we should provide that information. But >someone is providing it, I guess, in the FAQ. I'm sure it's just my system, but I've tried the instructions (even checked I was using capital M instead of lowercase m) and they don't work in Ubuntu. I would love to get

Re: Destructive Install Process (fdisk)

2020-06-25 Thread Theo de Raadt
David Blevins wrote: > Theo et al., > > I understand that it's an installer, but I do have an interest in > having an OpenBSD installing along side a GNU Linux installation. > That said, the basic "OpenBSD takes over the machine" install does > in fact work just fine. If that's the only

Re: Destructive Install Process (fdisk)

2020-06-25 Thread David Blevins
Theo et al., I understand that it's an installer, but I do have an interest in having an OpenBSD installing along side a GNU Linux installation. That said, the basic "OpenBSD takes over the machine" install does in fact work just fine. If that's the only intended use case why provide

Re: Destructive Install Process (fdisk)

2020-06-25 Thread Theo de Raadt
David Blevins wrote: > OpenBSD Community, > > I've been experimenting with the OpenBSD 6.7 install process (though > this "issue" is likely present in earlier version) and have noticed > that the fdisk program in the installation program will destructively > edit the hard drive upon selecting

Destructive Install Process (fdisk)

2020-06-25 Thread David Blevins
OpenBSD Community, I've been experimenting with the OpenBSD 6.7 install process (though this "issue" is likely present in earlier version) and have noticed that the fdisk program in the installation program will destructively edit the hard drive upon selecting either MBR or GPT partitioning. I

Re: pipex(4): use reference counters for `ifnet'

2020-06-25 Thread Vitaliy Makkoveev
> On 25 Jun 2020, at 16:35, Christiano F. Haesbaert > wrote: > > On Thu, 25 Jun 2020 at 14:06, Vitaliy Makkoveev > wrote: >> >> >> >>> On 25 Jun 2020, at 11:55, Martin Pieuchot wrote: >>> >>> On 24/06/20(Wed) 17:10, Vitaliy Makkoveev wrote: While `mbuf' enqueued to `pipexinq' or

Re: pipex(4): use reference counters for `ifnet'

2020-06-25 Thread Christiano F. Haesbaert
You can. The idea is that ifindex is always monotonically increased, so to actually get a new interface you would have to have "overflowed" 65k interfaces, which is unreal. So if your interface is gone, you can be sure if_get will give you NULL. On Thu, Jun 25, 2020, 18:55 Vitaliy Makkoveev

Re: ssh-keygen(1): -a is missing in SYNOPSIS and small wording change

2020-06-25 Thread Jason McIntyre
On Thu, Jun 25, 2020 at 06:40:36PM +0200, Solene Rapenne wrote: > I found that ssh-keygen(1) missed mention of -a flag in SYNOPSIS. > i think this got accidently removed in -r1.184: remove single letter flags for moduli operations > The following patch adds mention to [-a rounds] with

Re: pipex(4): use reference counters for `ifnet'

2020-06-25 Thread Vitaliy Makkoveev
> On 25 Jun 2020, at 11:55, Martin Pieuchot wrote: > > On 24/06/20(Wed) 17:10, Vitaliy Makkoveev wrote: >> While `mbuf' enqueued to `pipexinq' or `pipexoutq' it has the reference >> to corresponding pipex(4) session as `ph_cookie'. `ph_cookie' is >> accessed by pipexintr() and it's always

Re: [PATCH] net: prevent if_clone_destroy from racing with rest of stack

2020-06-25 Thread Vitaliy Makkoveev
On Thu, Jun 25, 2020 at 11:54:48AM +0200, Martin Pieuchot wrote: > On 23/06/20(Tue) 16:21, Martin Pieuchot wrote: > > On 23/06/20(Tue) 04:53, Jason A. Donenfeld wrote: > > > On 6/23/20, Martin Pieuchot wrote: > > > > On 23/06/20(Tue) 01:00, Jason A. Donenfeld wrote: > > > >> You can crash a

if_bce.c fix hang after resume

2020-06-25 Thread Richard Hopkins
I've managed to produce a patch to fix a hang after resume on my machine and would much appreciate some help with reviewing the changes, as whilst I've tried to follow the (excellent) documentation/FAQs this is new to me especially hardware. Original problem (on at least 6.6 and 6.7 i386) (dmesg

Re: make btrace interval event to reciprocal of ticks

2020-06-25 Thread Yuichiro NAITO
From: Martin Pieuchot Subject: Re: make btrace interval event to reciprocal of ticks Date: Thu, 25 Jun 2020 11:36:48 +0200 > On 23/06/20(Tue) 12:04, Yuichiro NAITO wrote: >> Current btrace has `interval:hz:1` probe that makes periodically events. >> `interval:hz:1` looks to make events once per

Re: [PATCH] net: prevent if_clone_destroy from racing with rest of stack

2020-06-25 Thread Vitaliy Makkoveev
On Tue, Jun 23, 2020 at 01:00:06AM -0600, Jason A. Donenfeld wrote: > You can crash a system by running something like: > > for i in 1 2 3; do while true; do ifconfig bridge0 create& ifconfig > bridge0 destroy& done& done > > This works with every type of interface I've tried. It appears

Re: pipex(4): use reference counters for `ifnet'

2020-06-25 Thread Christiano F. Haesbaert
On Thu, 25 Jun 2020 at 14:06, Vitaliy Makkoveev wrote: > > > > > On 25 Jun 2020, at 11:55, Martin Pieuchot wrote: > > > > On 24/06/20(Wed) 17:10, Vitaliy Makkoveev wrote: > >> While `mbuf' enqueued to `pipexinq' or `pipexoutq' it has the reference > >> to corresponding pipex(4) session as

top: Remove unused handle member

2020-06-25 Thread Klemens Nanni
The number of "remaining" processes in the handle struct is not used at all, it is is only ever set or decremented. As far as I can tell from CVS logs, this has been the case since machine.c revision 1.1 date: 1997/08/14 14:00:22; author: downsj; state: Exp; top 3.4,

Re: make btrace interval event to reciprocal of ticks

2020-06-25 Thread Lauri Tirkkonen
On Thu, Jun 25 2020 11:36:48 +0200, Martin Pieuchot wrote: > On 23/06/20(Tue) 12:04, Yuichiro NAITO wrote: > > Current btrace has `interval:hz:1` probe that makes periodically events. > > `interval:hz:1` looks to make events once per second (= 1Hz), > > but current implementation makes once per

Re: [PATCH] net: prevent if_clone_destroy from racing with rest of stack

2020-06-25 Thread Jason A. Donenfeld
On Thu, Jun 25, 2020 at 3:54 AM Vitaliy Makkoveev wrote: > ifp = ifunit(name); > if (ifp == NULL) > return (ENXIO); > + ifp->if_dying = 1; Reference counting, plus an explicit tear-down window, and wait period, like you've proposed sounds like a good idea.

Re: [PATCH] net: prevent if_clone_destroy from racing with rest of stack

2020-06-25 Thread Martin Pieuchot
On 23/06/20(Tue) 16:21, Martin Pieuchot wrote: > On 23/06/20(Tue) 04:53, Jason A. Donenfeld wrote: > > On 6/23/20, Martin Pieuchot wrote: > > > On 23/06/20(Tue) 01:00, Jason A. Donenfeld wrote: > > >> You can crash a system by running something like: > > >> > > >> for i in 1 2 3; do while

Re: [PATCH] net: prevent if_clone_destroy from racing with rest of stack

2020-06-25 Thread Jason A. Donenfeld
On Thu, Jun 25, 2020 at 2:49 AM Martin Pieuchot wrote: > > On 24/06/20(Wed) 19:54, Jason A. Donenfeld wrote: > > On Wed, Jun 24, 2020 at 4:02 AM Martin Pieuchot wrote: > > > Yes, that might be a better way. If I understood your original mail the > > > issue is related to ifunit(), right?

Re: make btrace interval event to reciprocal of ticks

2020-06-25 Thread Martin Pieuchot
On 23/06/20(Tue) 12:04, Yuichiro NAITO wrote: > Current btrace has `interval:hz:1` probe that makes periodically events. > `interval:hz:1` looks to make events once per second (= 1Hz), > but current implementation makes once per tick (= 100Hz on amd64). > I think the interval should be counted by

Re: pipex(4): use reference counters for `ifnet'

2020-06-25 Thread Martin Pieuchot
On 24/06/20(Wed) 17:10, Vitaliy Makkoveev wrote: > While `mbuf' enqueued to `pipexinq' or `pipexoutq' it has the reference > to corresponding pipex(4) session as `ph_cookie'. `ph_cookie' is > accessed by pipexintr() and it's always defferent context from context > where we destroy session.

Re: [PATCH] net: prevent if_clone_destroy from racing with rest of stack

2020-06-25 Thread Martin Pieuchot
On 24/06/20(Wed) 19:54, Jason A. Donenfeld wrote: > On Wed, Jun 24, 2020 at 4:02 AM Martin Pieuchot wrote: > > Yes, that might be a better way. If I understood your original mail the > > issue is related to ifunit(), right? ifunit() is not used in packet- > > processing contexts, that's why we

Re: [PATCH] net: prevent if_clone_destroy from racing with rest of stack

2020-06-25 Thread Vitaliy Makkoveev
> On 23 Jun 2020, at 10:00, Jason A. Donenfeld wrote: > > You can crash a system by running something like: > >for i in 1 2 3; do while true; do ifconfig bridge0 create& ifconfig > bridge0 destroy& done& done > > This works with every type of interface I've tried. It appears that >