dc(1); fix 0Z

2017-12-01 Thread Otto Moerbeek
Spotted while working on kshe's diff. Makes Z0p work the same as both gnu dc and the orignal dc. OK? -Otto Index: usr.bin/dc/bcode.c === RCS file: /cvs/src/usr.bin/dc/bcode.c,v retrieving revision 1.57 diff -u -p -r1.57

iked: ensure we accept all transforms

2017-12-01 Thread Patrick Wildt
Hi, I'm working on supporting receiving and sending multiple proposals. While doing that I realized that our proposal matching algorithm might accept a proposal we can't fully accept. The RFC specifies that to accept a proposal, we must select a transform for each transform type. We do some

Re: diff: cu(1): add secure kiosk mode + stricter pledge

2017-12-01 Thread Theo de Raadt
> The diff adds the option -k (for kiosk mode) Congratulations, you win some sort of prize. That is the worst-named option I have seen in more than a decade. Good idea though, but I think we have better getopt interfaces for blocking escapes in other commands. ssh has to do this, and I

diff: cu(1): add secure kiosk mode + stricter pledge

2017-12-01 Thread Jan Klemkow
Hi, I run cu(1) as ssh forced command for other users on my machine. This allows them to reach the serial port of their machines over mine. To prevent them of doing filesystem operations or further command executions I implement this diff. The diff adds the option -k (for kiosk mode) to cu(1)

Re: pf divert socket lookup

2017-12-01 Thread Alexandr Nedvedicky
Hello, On Fri, Dec 01, 2017 at 04:43:30PM +0100, Alexander Bluhm wrote: > Hi, > > I want to make divert lookup similar for all socket types: > > If PF_TAG_DIVERTED is set, pf_find_divert() cannot fail so put an > assert there. Explicitly check all possible divert types, panic > in the default

Re: dc(1): floor(log_10(x)) should not cost more than O(log(log(x)))

2017-12-01 Thread kshe
On Fri, 01 Dec 2017 08:58:55 +, Otto Moerbeek wrote: > On Thu, Nov 30, 2017 at 01:10:33PM +, kshe wrote: > > On Thu, 30 Nov 2017 07:22:42 +, Otto Moerbeek wrote: > > > On Sun, Nov 26, 2017 at 07:40:03PM +, kshe wrote: > > > > Hi, > > > > > > > > The `Z' command can be a handy

Re: sparc64 ci_cpuid

2017-12-01 Thread Theo de Raadt
> Martin Pieuchot schreef op 2017-12-01 15:36: > > sparc64 uses a different name of storing the CPU number. I'd like to > > use `ci_cpuid' to be able to use it in MI code without adding another > > abstraction layer. > > > > Diff below is just a rename, ok? > > ok kettenis@ OK with me also.

Sync disks in a better way

2017-12-01 Thread Theo de Raadt
For more than a decade I have pointed out vfs_shutdown does a terrible job, but noone took the bait to fix it. It uses proc0, does spl0, and a loop which makes it clear the operation may fail... and we've see evidence the loop fails. It really cannot gaurantee the filesystem is clean. bluhm

Don't send icmp redirect to the same interface a forwarded packet came in on

2017-12-01 Thread Christopher Zimmermann
Hi, by accident I discovered this rather senseless redirect: $ doas tcpdump -eptni vlan2 icmp tcpdump: listening on vlan2, link-type EN10MB 11:11:11:11:11:11 22:22:22:22:22 0800 98: 192.168.1.2 > 192.168.4.7: icmp: echo request 22:22:22:22:22 11:11:11:11:11:11 0800 98: 192.168.4.7 >

Re: iked: send correct proposal number

2017-12-01 Thread Stuart Henderson
On 2017/11/30 18:20, Patrick Wildt wrote: > Hi, > > the RFC specifies that in an SA payload the proposals must be numbered > starting with number 1. Subsequent proposals must be one more than the > previous proposal. > > Since IKE SA proposals and Child SA proposals are a different list, > we

Re: sparc64 ci_cpuid

2017-12-01 Thread Miod Vallat
> sparc64 uses a different name of storing the CPU number. I'd like to > use `ci_cpuid' to be able to use it in MI code without adding another > abstraction layer. Isn't that what CPU_INFO_UNIT() is for?

pf divert socket lookup

2017-12-01 Thread Alexander Bluhm
Hi, I want to make divert lookup similar for all socket types: If PF_TAG_DIVERTED is set, pf_find_divert() cannot fail so put an assert there. Explicitly check all possible divert types, panic in the default case. For raw sockets call pf_find_divert() before of the socket loop. Divert reply

Re: sparc64 ci_cpuid

2017-12-01 Thread Mark Kettenis
Martin Pieuchot schreef op 2017-12-01 15:36: sparc64 uses a different name of storing the CPU number. I'd like to use `ci_cpuid' to be able to use it in MI code without adding another abstraction layer. Diff below is just a rename, ok? ok kettenis@ Index: include/cpu.h

Re: pcb lookup listen PF_TAG_TRANSLATE_LOCALHOST

2017-12-01 Thread Alexandr Nedvedicky
Hello, On Thu, Nov 30, 2017 at 06:09:16PM +0100, Alexander Bluhm wrote: > Hi, > > I would like to simplify the reverse pcb lookup logic. The > PF_TAG_TRANSLATE_LOCALHOST security check predates the divert > feature. It prevents that you accidentally use redirect where a > divert-to would be

Which CPU hold the KERNEL_LOCK()

2017-12-01 Thread Martin Pieuchot
I'd like to easily see which CPU is holding the KERNEL_LOCK() in ddb(4)'s "ps /o" output. This is really handy when debugging deadlocks. So the diff below adds a 'struct cpu_info *' argument to __mp_lock_held() and use it in the corresponding DDB command. Note that this requires the previous

sparc64 ci_cpuid

2017-12-01 Thread Martin Pieuchot
sparc64 uses a different name of storing the CPU number. I'd like to use `ci_cpuid' to be able to use it in MI code without adding another abstraction layer. Diff below is just a rename, ok? Index: include/cpu.h === RCS file:

Re: wprintf.3: fix synopsis

2017-12-01 Thread Ingo Schwarze
Hi, kshe wrote on Thu, Nov 30, 2017 at 11:56:13PM +: > This adds a missing parameter name and makes whitespace more consistent > in the synopsis of wprintf(3). As a bonus, also link to this manual > from plain printf(3). Committed with tweaks, thanks. Ingo > Index: printf.3 >

Re: dc(1): floor(log_10(x)) should not cost more than O(log(log(x)))

2017-12-01 Thread Theo Buehler
On Fri, Dec 01, 2017 at 09:58:55AM +0100, Otto Moerbeek wrote: > On Thu, Nov 30, 2017 at 01:10:33PM +, kshe wrote: > > > On Thu, 30 Nov 2017 07:22:42 +, Otto Moerbeek wrote: > > > On Sun, Nov 26, 2017 at 07:40:03PM +, kshe wrote: > > > > Hi, > > > > > > > > The `Z' command can be a

Re: sshd_config.5.patch

2017-12-01 Thread Jason McIntyre
On Thu, Nov 30, 2017 at 09:00:26PM -0600, Edgar Pettijohn wrote: > While playing with sftp-server I noticed that sshd_config.5 claims there > are no Subsystems enabled by default. I could be wrong, but my > sshd_config had sftp-server enabled by default. > > --- sshd_config.5.orig Thu Nov 30

Re: gre(4): remove linkX from example

2017-12-01 Thread Jason McIntyre
On Thu, Nov 30, 2017 at 08:37:31PM -0300, Lucas Gabriel Vuotto wrote: > Hi tech@, > > According rev 1.45, linkX in gre(4) is a deprecated style and isn't > documented in ifconfig(8) (couldn't find it ever was, but I'm not to used to > cvs so I couldn't search properly). This removes linkX from

Re: dc(1): floor(log_10(x)) should not cost more than O(log(log(x)))

2017-12-01 Thread Otto Moerbeek
On Thu, Nov 30, 2017 at 01:10:33PM +, kshe wrote: > On Thu, 30 Nov 2017 07:22:42 +, Otto Moerbeek wrote: > > On Sun, Nov 26, 2017 at 07:40:03PM +, kshe wrote: > > > Hi, > > > > > > The `Z' command can be a handy shortcut for computing logarithms; as > > > such, for example, it is the