Re: Add kernel stack trace saving for riscv64

2022-03-08 Thread Jeremie Courreges-Anglas
On Tue, Mar 08 2022, Visa Hankala wrote: > This patch adds kernel stack trace saving for riscv64, for the benefit > of dt(4) and witness(4). Nice! > The unwinder is slow because of the symbol > lookup, but this can be tweaked later. A dumb approach that appears to work: add

wg(4): 'Address already in use' when wgrtable is changed

2022-03-08 Thread Yuichiro NAITO
I see 'Address already in use' message, when I change wgrtable for a running wg interface. It doesn't make sense to me. It can be reproduced by the following command sequence. ``` # route -T1 add default `cat /etc/mygate` # ifconfig wg0 create wgport 7111 wgkey `cat /etc/mykey.wg0` # ifconfig

Re: ieee80211_stats userland vs. kernel

2022-03-08 Thread Theo de Raadt
Stefan Sperling wrote: > On Tue, Mar 08, 2022 at 12:58:27PM -0700, Theo de Raadt wrote: > > Claudio Jeker wrote: > > > > > Honestly I think this is overkill. There is no stat struct where we do > > > this dance. It is accepted that netstat needs to keep in sync for these > > > structs to work.

Re: ieee80211_stats userland vs. kernel

2022-03-08 Thread Stefan Sperling
On Tue, Mar 08, 2022 at 12:58:27PM -0700, Theo de Raadt wrote: > Claudio Jeker wrote: > > > Honestly I think this is overkill. There is no stat struct where we do > > this dance. It is accepted that netstat needs to keep in sync for these > > structs to work. Why is it necessary to disconnect

Re: ipsec policy refcount

2022-03-08 Thread Tobias Heider
On Tue, Mar 08, 2022 at 08:17:13PM +0100, Alexander Bluhm wrote: > Hi, > > In IPsec policy replace integer refcount with atomic refcount. > > It is a bit strange that ipo_refcnt is never taken, but let's go > towards MP safety in small steps. > > ok? > > bluhm ok tobhe@ > > Index:

Re: ieee80211_stats userland vs. kernel

2022-03-08 Thread Theo de Raadt
Claudio Jeker wrote: > Honestly I think this is overkill. There is no stat struct where we do > this dance. It is accepted that netstat needs to keep in sync for these > structs to work. Why is it necessary to disconnect the kernel and userland > for this? Actually there is a major one: it is

Re: ieee80211_stats userland vs. kernel

2022-03-08 Thread Claudio Jeker
On Tue, Mar 08, 2022 at 07:17:33PM +0100, Stefan Sperling wrote: > On Tue, Mar 08, 2022 at 03:55:48PM +0100, Stefan Sperling wrote: > > On Mon, Mar 07, 2022 at 03:04:06PM -0700, Theo de Raadt wrote: > > > > For now, the structs are identical so the code copying data out is > > > > kept simple. > >

Re: simplify mutexes for pf state table in pfsync

2022-03-08 Thread Alexander Bluhm
On Tue, Mar 08, 2022 at 05:49:22PM +0100, Alexandr Nedvedicky wrote: > Hello, > > my original idea was to have a one mutex per pfsync queue. however it creates > things more complicated then necessary for queues, which keep pf(4) state. > hrvoje@ hit some panics in this area recently. bluhm@ and

ipsec policy refcount

2022-03-08 Thread Alexander Bluhm
Hi, In IPsec policy replace integer refcount with atomic refcount. It is a bit strange that ipo_refcnt is never taken, but let's go towards MP safety in small steps. ok? bluhm Index: net/pfkeyv2.c === RCS file:

Re: ieee80211_stats userland vs. kernel

2022-03-08 Thread Stefan Sperling
On Tue, Mar 08, 2022 at 03:55:48PM +0100, Stefan Sperling wrote: > On Mon, Mar 07, 2022 at 03:04:06PM -0700, Theo de Raadt wrote: > > > For now, the structs are identical so the code copying data out is > > > kept simple. > > > > I think this is unwise, and you should write the field-by-field

Add kernel stack trace saving for riscv64

2022-03-08 Thread Visa Hankala
This patch adds kernel stack trace saving for riscv64, for the benefit of dt(4) and witness(4). The unwinder is slow because of the symbol lookup, but this can be tweaked later. The limit variable prevents the unwinder from using user-controllable register values. The limit has to reflect the

simplify mutexes for pf state table in pfsync

2022-03-08 Thread Alexandr Nedvedicky
Hello, my original idea was to have a one mutex per pfsync queue. however it creates things more complicated then necessary for queues, which keep pf(4) state. hrvoje@ hit some panics in this area recently. bluhm@ and I are still looking at those issues. However there is the first change in

atomic read write

2022-03-08 Thread Alexander Bluhm
Hi, Once we had the discussion where we need the READ_ONCE() macro. As modern C compiler has much freedom how to access memory, I came to the conclusion that it would be wise to use READ_ONCE() and WRITE_ONCE() everywhere when we use atomic operations variables. Using atomic operations on one

Re: bgpd expand macros in strings

2022-03-08 Thread Theo Buehler
On Tue, Mar 08, 2022 at 02:36:00PM +0100, Claudio Jeker wrote: > bgpd's parse.y uses a lot of STRING that is then further bisected in the > actual rule. One good example are all communities. Now if someone wants to > use macros in such arguments they do not work in all cases. e.g. >

Re: ieee80211_stats userland vs. kernel

2022-03-08 Thread Stefan Sperling
On Mon, Mar 07, 2022 at 03:04:06PM -0700, Theo de Raadt wrote: > > For now, the structs are identical so the code copying data out is > > kept simple. > > I think this is unwise, and you should write the field-by-field copying > function at the same time, otherwise this is just asking for

Re: pluart(4): fifo support

2022-03-08 Thread Visa Hankala
On Tue, Mar 08, 2022 at 08:04:36AM +0100, Anton Lindqvist wrote: > On Mon, Mar 07, 2022 at 07:36:35AM +, Visa Hankala wrote: > > I still think that checking TXFF and using the same code for both > > SBSA and true PL011 UARTs would be the best choice. This would avoid > > fragmenting the code

bgpd expand macros in strings

2022-03-08 Thread Claudio Jeker
bgpd's parse.y uses a lot of STRING that is then further bisected in the actual rule. One good example are all communities. Now if someone wants to use macros in such arguments they do not work in all cases. e.g. large-community $someas:1:2 works but large-community 1:$someas:2 does not. Right

Re: [patch] ksh: backspace in search-history buffer with UTF8 chars

2022-03-08 Thread Mikhail
On Tue, Mar 08, 2022 at 03:15:55PM +0300, Mikhail wrote: > Inlined diff helps ksh search-history function (ctrl-r) to handle > backspace for UTF8 characters properly, without the patch, if I have > UTF8 characters in my search buffer, I need to press backspace twice to > push cursor to the left. >

Re: bgpd: plug leaks in rtr_parse_ipv{4,6}_prefix()

2022-03-08 Thread Claudio Jeker
On Tue, Mar 08, 2022 at 01:33:01PM +0100, Theo Buehler wrote: > If the length checks trigger, roa is leaked. It makes more sense to me > to copy the data into ip4 and ip6, check lengths and then calloc rather > than the current order, so I moved the calloc down a bit. Alternatively, > we could

bgpd: plug leaks in rtr_parse_ipv{4,6}_prefix()

2022-03-08 Thread Theo Buehler
If the length checks trigger, roa is leaked. It makes more sense to me to copy the data into ip4 and ip6, check lengths and then calloc rather than the current order, so I moved the calloc down a bit. Alternatively, we could just add a free(roa) before the return -1 in the length checks. Index:

[patch] ksh: backspace in search-history buffer with UTF8 chars

2022-03-08 Thread Mikhail
Inlined diff helps ksh search-history function (ctrl-r) to handle backspace for UTF8 characters properly, without the patch, if I have UTF8 characters in my search buffer, I need to press backspace twice to push cursor to the left. The search itself is not perfect for UTF8 either, sometimes I get