[patch] Test for sysctl call fail in usr.bin/systat/pigs.c

2018-05-03 Thread Nan Xiao
Hi tech@, Maybe it is need to check sysctl return value in usr.bin/systat/pigs.c. E.g., in read_pg() function: .. size = sizeof(ctimes); sysctl(cp_time_mib, 2, , , NULL, 0); t = 0; for (i = 0; i < CPUSTATES; i++) t += ctimes[i] -

Symlinks for shared libraries

2018-05-03 Thread Mark Kettenis
As we discussed some time ago, adding symlinks like libfoo.so -> libfoo.so.x.y brings us more in line with other ELF platforms and will allow us to drop some OpenBSD-specific code from our linkers. It also makes it possible for developers to easily revert a library version bump. The symlinks

[patch] add missing pledge to aucat(1).

2018-05-03 Thread Jesper Wallin
Hi all, I just noticed that aucat(1) is missing pledge. However, I'm aware that aucat(1) is talking to sndiod(8), which is being pledged properly. But seeing that programs like yes(1) is properly pledged, I don't see any reason not to pledge aucat(1) as well, unless I'm missing something

Re: reduce hppa interrupt guts awfulness

2018-05-03 Thread Mark Kettenis
> Date: Thu, 3 May 2018 17:18:56 + > From: Miod Vallat > > > Regarding your diff. The approach seems reasonable to me. The magic > > number in the gscbus.c doesn't fill me with joy. > > > > > + r[4] = cpu_gethpa(0) | (31 - irqbit); /* iar */ > > > > I realise

Re: reduce hppa interrupt guts awfulness

2018-05-03 Thread Miod Vallat
> Regarding your diff. The approach seems reasonable to me. The magic > number in the gscbus.c doesn't fill me with joy. > > > + r[4] = cpu_gethpa(0) | (31 - irqbit); /* iar */ > > I realise you're following existing practice, but maybe you could you > add a gscbus_reg struct

unbreak gsckbc (possibly iockbc and mkbc)

2018-05-03 Thread Miod Vallat
sys/dev/pckbc/pckbd.c introduces a buglet, where the value computed for local variable `table' in pckbd_set_xtscancode() in the non-translating case, is overwritten by accident. Unfortunately, this means that the keyboard ends up using a scancode set which is not the one expected by the driver,

Re: libkvm requires kvm_getargv before kvm_getenv when both needed

2018-05-03 Thread Otto Moerbeek
On Thu, May 03, 2018 at 07:15:24PM +0300, Vadim Zhukov wrote: > 2018-05-03 18:59 GMT+03:00 Otto Moerbeek : > > Yes, looks good from reading. But all te extra checks before calling > > free can go. That's idiom from a *long* time ago. > > Like that? I've checked all free() calls

Re: libkvm requires kvm_getargv before kvm_getenv when both needed

2018-05-03 Thread Vadim Zhukov
2018-05-03 18:59 GMT+03:00 Otto Moerbeek : > Yes, looks good from reading. But all te extra checks before calling > free can go. That's idiom from a *long* time ago. Like that? I've checked all free() calls in libkvm. I've also added zeroing of vmst field in mips64 code, like

Re: libkvm requires kvm_getargv before kvm_getenv when both needed

2018-05-03 Thread Todd C. Miller
On Thu, 03 May 2018 17:59:39 +0200, Otto Moerbeek wrote: > Yes, looks good from reading. But all te extra checks before calling > free can go. That's idiom from a *long* time ago. There is more cleanup that can be done in this code. For example, the use of 0 instead of NULL. But that can be a

Re: libkvm requires kvm_getargv before kvm_getenv when both needed

2018-05-03 Thread Otto Moerbeek
On Thu, May 03, 2018 at 09:19:01AM -0600, Todd C. Miller wrote: > On Thu, 03 May 2018 13:58:35 +0300, Vadim Zhukov wrote: > > > Here is patch for libkvm that fixes a few memory handling problems. > > Most changes are mechanical, with some exceptions: > > > > 1. Most notable: this splits argv

Re: Explain 'S' short-hand in malloc.conf

2018-05-03 Thread Otto Moerbeek
On Thu, May 03, 2018 at 04:57:55PM +0200, Christian Ludwig wrote: > The 'S' flag in malloc.conf(5) is a short-hand for several other flags. > Explain > which flags it sets exactly. > --- > share/man/man5/malloc.conf.5 | 10 +- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff

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

2018-05-03 Thread Christopher Zimmermann
On 2018-05-03 Martin Pieuchot wrote: > On 02/05/18(Wed) 14:45, Christopher Zimmermann wrote: > > On 2018-05-02 Martin Pieuchot wrote: > > > On 02/05/18(Wed) 11:47, Christopher Zimmermann wrote: > > > > I just want to bring this up again. Can some network

Re: libkvm requires kvm_getargv before kvm_getenv when both needed

2018-05-03 Thread Todd C. Miller
On Thu, 03 May 2018 13:58:35 +0300, Vadim Zhukov wrote: > Here is patch for libkvm that fixes a few memory handling problems. > Most changes are mechanical, with some exceptions: > > 1. Most notable: this splits argv buffer into argv-specific one > and environ-specific one. This makes ps

Re: Explain 'S' short-hand in malloc.conf

2018-05-03 Thread Ingo Schwarze
Hi Christian, Christian Ludwig wrote on Thu, May 03, 2018 at 04:57:55PM +0200: > The 'S' flag in malloc.conf(5) is a short-hand for several other flags. > Explain which flags it sets exactly. Your diff is *not* OK. These details are intentionally undocumented because they change often. This

Explain 'S' short-hand in malloc.conf

2018-05-03 Thread Christian Ludwig
The 'S' flag in malloc.conf(5) is a short-hand for several other flags. Explain which flags it sets exactly. --- share/man/man5/malloc.conf.5 | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/share/man/man5/malloc.conf.5 b/share/man/man5/malloc.conf.5 index

Re: in6_ioctl(): use read lock for SIOCGIF*_IN6

2018-05-03 Thread Hrvoje Popovski
On 3.5.2018. 1:53, Theo Buehler wrote: > On Wed, May 02, 2018 at 04:25:20PM +0200, Hrvoje Popovski wrote: >> On 2.5.2018. 12:16, Theo Buehler wrote: >>> Here's a further refactoring of in6_ioctl() that splits out the >>> SIOCGIF*_IN6 cases into the new function in6_ioctl_get(), where we only >>>

Re: libkvm requires kvm_getargv before kvm_getenv when both needed

2018-05-03 Thread Vadim Zhukov
2018-05-02 16:54 GMT+03:00 Todd C. Miller : > On Tue, 01 May 2018 13:35:54 -0600, "Theo de Raadt" wrote: >> > b) Their working space should be independent of each other. This >> > isn't hard, just splitting kd->argbuf into kd->argbuf and >> > kd->envbuf. Seems a

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

2018-05-03 Thread Martin Pieuchot
On 02/05/18(Wed) 14:45, Christopher Zimmermann wrote: > On 2018-05-02 Martin Pieuchot wrote: > > On 02/05/18(Wed) 11:47, Christopher Zimmermann wrote: > > > I just want to bring this up again. Can some network guru give me an ok > > > or some feedback please? > > > > Can you

Re: SMCCC 1.1 support for psci(4)

2018-05-03 Thread Dimitris Papastamos
On Thu, May 03, 2018 at 11:32:42AM +0200, Mark Kettenis wrote: > > Date: Thu, 3 May 2018 08:19:01 +0100 > > From: Dimitris Papastamos > > Hi Dimitris, > > > On Tue, May 01, 2018 at 11:55:00AM +0200, Mark Kettenis wrote: > > > So after adding a quick hack to mitigate Spectre

Re: SMCCC 1.1 support for psci(4)

2018-05-03 Thread Mark Kettenis
> Date: Thu, 3 May 2018 08:19:01 +0100 > From: Dimitris Papastamos Hi Dimitris, > On Tue, May 01, 2018 at 11:55:00AM +0200, Mark Kettenis wrote: > > So after adding a quick hack to mitigate Spectre variant 2 to ARM > > Trusted Firmware (ATF), ARM actually designed a proper

Re: SMCCC 1.1 support for psci(4)

2018-05-03 Thread Dimitris Papastamos
On Tue, May 01, 2018 at 11:55:00AM +0200, Mark Kettenis wrote: > So after adding a quick hack to mitigate Spectre variant 2 to ARM > Trusted Firmware (ATF), ARM actually designed a proper solution that > minimizes the performance loss and makes the presence of the > workaround detectable. This is

Re: SMCCC 1.1 support for psci(4)

2018-05-03 Thread Dimitris Papastamos
On Thu, May 03, 2018 at 08:19:01AM +0100, Dimitris Papastamos wrote: > On Tue, May 01, 2018 at 11:55:00AM +0200, Mark Kettenis wrote: > > So after adding a quick hack to mitigate Spectre variant 2 to ARM > > Trusted Firmware (ATF), ARM actually designed a proper solution that > > minimizes the

Re: [patch] Check memory allocation error in usr.bin/systat/vmstat.c

2018-05-03 Thread Otto Moerbeek
On Thu, May 03, 2018 at 09:37:50AM +0200, Otto Moerbeek wrote: > On Thu, May 03, 2018 at 02:49:03PM +0800, Nan Xiao wrote: > > > Hi tech@, > > > > A patch for usr.bin/systat/vmstat.c, apologize if I'm wrong. > > > > Index: vmstat.c > >

Re: [patch] Check memory allocation error in usr.bin/systat/vmstat.c

2018-05-03 Thread Otto Moerbeek
On Thu, May 03, 2018 at 02:49:03PM +0800, Nan Xiao wrote: > Hi tech@, > > A patch for usr.bin/systat/vmstat.c, apologize if I'm wrong. > > Index: vmstat.c > === > RCS file: /cvs/src/usr.bin/systat/vmstat.c,v > retrieving revision

[patch] Check memory allocation error in usr.bin/systat/vmstat.c

2018-05-03 Thread Nan Xiao
Hi tech@, A patch for usr.bin/systat/vmstat.c, apologize if I'm wrong. Index: vmstat.c === RCS file: /cvs/src/usr.bin/systat/vmstat.c,v retrieving revision 1.82 diff -u -p -r1.82 vmstat.c --- vmstat.c18 Dec 2016 23:36:32 -