Re: posix_openpt: allow O_CLOEXEC

2020-02-06 Thread Philip Guenther
On Thu, Feb 6, 2020 at 11:38 AM joshua stein wrote: > On Thu, 06 Feb 2020 at 11:21:11 -0700, Todd C. Miller wrote: > > On Thu, 06 Feb 2020 10:45:44 -0700, "Theo de Raadt" wrote: > > > > > That feels better, and will be more atomic. > > > > Unfortunately, we can't do this in ptmioctl() since we do

Add mprotect_ept ioctl to vmm(4)

2020-02-06 Thread Adam Steen
Hi Please see the attached patch to add an 'IOCTL handler to sets the access protections of the ept' vmd(8) does not make use of this change, but solo5, which uses vmm(4) as a backend hypervisor. The code calling 'VMM_IOC_MPROTECT_EPT' is available here https://github.com/Solo5/solo5/compare/mast

Re: syslogd closing all udp is a tiny bit aggressiv

2020-02-06 Thread sven falempin
On Thu, Feb 6, 2020 at 5:32 PM Alexander Bluhm wrote: > > On Thu, Feb 06, 2020 at 11:46:25AM -0500, sven falempin wrote: > > If for exemple there s a wrong endpoint in the config file, like > > local1.warn @badhost > > and no other the daemon will close fd_udp. > > Your DNS lookup fails at startu

Re: syslogd closing all udp is a tiny bit aggressiv

2020-02-06 Thread Alexander Bluhm
On Thu, Feb 06, 2020 at 11:46:25AM -0500, sven falempin wrote: > If for exemple there s a wrong endpoint in the config file, like > local1.warn @badhost > and no other the daemon will close fd_udp. Your DNS lookup fails at startup, sockets are closed. > // reload with a badhost in /etc/hosts for

let "man -w" print the manpath

2020-02-06 Thread Ingo Schwarze
Hello, i'm suggesting a user-visible change in the behaviour of man(1). Currently, "man -w" without any argument prints the usage() message and exits with error code 5. I propose to instead print the manpath and exit successfully. This is motivated by the following facts: 1. It is what the man

Re: posix_openpt: allow O_CLOEXEC

2020-02-06 Thread joshua stein
On Thu, 06 Feb 2020 at 12:41:47 -0700, Theo de Raadt wrote: > > Index: stdlib/posix_pty.c > > === > > RCS file: /cvs/src/lib/libc/stdlib/posix_pty.c,v > > retrieving revision 1.3 > > diff -u -p -u -p -r1.3 posix_pty.c > > --- stdlib/po

Re: posix_openpt: allow O_CLOEXEC

2020-02-06 Thread Theo de Raadt
Related to previous, +.It Dv O_CLOEXEC +Set the close-on-exec flag for the new file descriptor. Should this say Set the close-on-exec flag on the .Va aslave file descriptor. Or, what is supposed to happen to the master? Is that specified or ignored?

Re: posix_openpt: allow O_CLOEXEC

2020-02-06 Thread Theo de Raadt
joshua stein wrote: > On Thu, 06 Feb 2020 at 11:21:11 -0700, Todd C. Miller wrote: > > On Thu, 06 Feb 2020 10:45:44 -0700, "Theo de Raadt" wrote: > > > > > That feels better, and will be more atomic. > > > > Unfortunately, we can't do this in ptmioctl() since we don't have > > the index of the

Re: posix_openpt: allow O_CLOEXEC

2020-02-06 Thread joshua stein
On Thu, 06 Feb 2020 at 11:21:11 -0700, Todd C. Miller wrote: > On Thu, 06 Feb 2020 10:45:44 -0700, "Theo de Raadt" wrote: > > > That feels better, and will be more atomic. > > Unfortunately, we can't do this in ptmioctl() since we don't have > the index of the open ptm device to use to check for

Re: posix_openpt: allow O_CLOEXEC

2020-02-06 Thread Todd C . Miller
On Thu, 06 Feb 2020 10:45:44 -0700, "Theo de Raadt" wrote: > That feels better, and will be more atomic. Unfortunately, we can't do this in ptmioctl() since we don't have the index of the open ptm device to use to check for the presence of UF_EXCLOSE. So it has to be done in libc instead. - to

Re: posix_openpt: allow O_CLOEXEC

2020-02-06 Thread Theo de Raadt
Todd C. Miller wrote: > Alternately, we could teach PTMGET to copy the close-on-exec flag > from the ptm fd. That feels better, and will be more atomic. Two 1 line diffs in tty_pty.c In the man page, it is easy also device. The PTMGET command allocates a free pseudo terminal, changes it

Re: posix_openpt: allow O_CLOEXEC

2020-02-06 Thread Todd C . Miller
Alternately, we could teach PTMGET to copy the close-on-exec flag from the ptm fd. - todd

Re: posix_openpt: allow O_CLOEXEC

2020-02-06 Thread Todd C . Miller
This doesn't do what you think it does. You are setting O_CLOEXEC on the fd for /dev/ptm (which is immediately closed), not on the pty master or slave fds. You will need to explicitly set the close-on-exec flag on the master using something like: fcntl(ptm.cfd, F_SETFD, FD_CLOEXEC); - todd

syslogd closing all udp is a tiny bit aggressiv

2020-02-06 Thread sven falempin
Hello, Syslogd is supposed to reload the configuration on HUP, and does it well but for one case. If the demon does not have any endpoint it will close the FD opened *at start* line 587 /* * If generic UDP file descriptors are used neither * for receiving nor for sending, close them. Then * the

Re: posix_openpt: allow O_CLOEXEC

2020-02-06 Thread joshua stein
On Wed, 05 Feb 2020 at 17:48:41 -0700, Todd C. Miller wrote: > On Wed, 05 Feb 2020 15:47:37 -0600, joshua stein wrote: > > > The spec says the behavior of anything other than O_RDWR and > > O_NOCTTY is unspecified, but FreeBSD allows passing O_CLOEXEC. > > OK, but the manual needs to specify tha

iwm: work around missing Tx completion interrupts

2020-02-06 Thread Stefan Sperling
At 36c3 I noticed roaming failures with iwm(4) where we would get stuck trying to roam to a different AP. Debugging this with bluhm@ we found that the reason it gets stuck is a non-zero refcount on the ic_bss node. When roaming, we wait for this reference count to hit zero before switching the new

PT_ATTACH wait(2) and reparent

2020-02-06 Thread Martin Pieuchot
As exposed recently via the t_ptrace regression and some make changes an exit status might reported twice to its parent via wait(2). The diff below fixes that by making sure we do not re-parent a child to the same parent. With it the above mentioned regression as well as the ptrace one that I'm p

Re: ldom.conf: Support devlias keyword for vdisk

2020-02-06 Thread Andrew Grillet
This looks really useful On Wed, 5 Feb 2020 at 21:38, Klemens Nanni wrote: > On Wed, Feb 05, 2020 at 09:35:25PM +0100, Klemens Nanni wrote: > > Straight forward diff to allow calling disks names: > > > > $ cat ldom.conf > > domain guest { > > vcpu 4 > > me

Re: vmm(4) patch - iniatialise eptp to zero for vmx like svm

2020-02-06 Thread Mike Larkin
On Thu, Feb 06, 2020 at 01:05:01AM -0800, Mike Larkin wrote: > On Thu, Feb 06, 2020 at 02:34:47AM +, Adam Steen wrote: > > Hi > > > > Again while working on a larger patch i noticed that the eptp for vmx > > was not getting initialised to zero like the svm code path, as part of > > a VMM_IOC_R

Re: vmm(4) patch - iniatialise eptp to zero for vmx like svm

2020-02-06 Thread Mike Larkin
On Thu, Feb 06, 2020 at 02:34:47AM +, Adam Steen wrote: > Hi > > Again while working on a larger patch i noticed that the eptp for vmx > was not getting initialised to zero like the svm code path, as part of > a VMM_IOC_RESETCPU ioctl call. > > please see the attach patch to initialise eptp t