libc: make internal _malloc_init() calls go direct

2016-09-10 Thread Philip Guenther
Diff below makes the calls to _malloc_init() from inside libc go direct, while leaving malloc_init() callable from outside for libpthread, eliminating the overridable PLT entry for _malloc_init. ok? With the harsh light of California beating down on me, I now wonder if we should have

libm: make sqrtl() use fe*() instead of fp*()

2016-09-10 Thread Philip Guenther
On systems that don't have a native version, we use an implementation of sqrtl() (square-root of long double) that -- to do its job -- pokes at the floating-point exception state and rounding mode. In particular, at a key point it clears any previous "inexact" exception and sets the rounding

Re: binutils-2.17 ownership fixes

2016-09-10 Thread Philip Guenther
On Sat, 10 Sep 2016, Philip Guenther wrote: > Same diff as binutils, with same open question: > > > Maybe we should add ${INSTALL_STRIP} to the INSTALL_PROGRAM assignment > > here? Here's the combined diff that does that. (Note to self: if you set DEBUG in /etc/mk.conf, INSTALL_STRIP isn't

Re: /usr/sbin/sysctl owner

2016-09-10 Thread Philip Guenther
On Sat, Sep 10, 2016 at 1:42 PM, Philip Guenther wrote: > On Sat, 10 Sep 2016, Philip Guenther wrote: > >> On Sat, 10 Sep 2016, Martin Natano wrote: >> > Yet another symlink that belongs to root. Ok? >> ... >> > --- sbin/sysctl/Makefile4 May 2016 19:48:08 - 1.11

binutils-2.17 ownership fixes

2016-09-10 Thread Philip Guenther
Same diff as binutils, with same open question: > Maybe we should add ${INSTALL_STRIP} to the INSTALL_PROGRAM assignment > here? ok? Index: usr.bin/binutils-2.17/Makefile.bsd-wrapper === RCS file:

binutils ownership fixes

2016-09-10 Thread Philip Guenther
This should fix the ownership (and mode) of /usr/bin/gdb and its associated info pages. ok? One open question: we never strip gdb, unlike other binaries. Maybe we should add ${INSTALL_STRIP} to the INSTALL_PROGRAM assignment here? Philip Guenther Index:

Re: more clang libc fun

2016-09-10 Thread Philip Guenther
On Sat, 10 Sep 2016, Mark Kettenis wrote: > From: Philip Guenther ... > > Also interesting that it generates memmove() calls. Wonder where it > > ended up doing that. > > Well, clang actually calls the functions with their standard name even > for the cases where we

Re: more clang libc fun

2016-09-10 Thread Mark Kettenis
> Date: Sat, 10 Sep 2016 13:55:15 -0700 > From: Philip Guenther > > On Sat, 10 Sep 2016, Mark Kettenis wrote: > > Thanks. Now the only issue seems to be: > > > > barber$ check_sym > > /usr/lib/libc.so.89.1 --> obj/libc.so.89.1 > > Dynamic export changes: > > PLT added: >

Re: mailwrapper symlinks owner

2016-09-10 Thread Philip Guenther
On Sat, 10 Sep 2016, Martin Natano wrote: > Another set of symlinks, same drill: the owner should be root. Ok? ... > --- usr.sbin/mailwrapper/Makefile 16 Mar 2009 22:34:13 - 1.5 > +++ usr.sbin/mailwrapper/Makefile 10 Sep 2016 17:53:45 - > @@ -13,5 +13,9 @@ afterinstall: >

Re: create /usr/share/calendar/$lang with root owner

2016-09-10 Thread Philip Guenther
On Sat, 10 Sep 2016, Martin Natano wrote: > Currently the /usr/share/calendar/$lang directories are created with the > build user as owner, but should be owned by root. Ok? ok guenther@

Re: more clang libc fun

2016-09-10 Thread Philip Guenther
On Sat, 10 Sep 2016, Mark Kettenis wrote: > Thanks. Now the only issue seems to be: > > barber$ check_sym > /usr/lib/libc.so.89.1 --> obj/libc.so.89.1 > Dynamic export changes: > PLT added: > __stack_smash_handler > memcpy > memmove > memset > > Not sure how to

Re: more clang libc fun

2016-09-10 Thread Mark Kettenis
> Date: Sat, 10 Sep 2016 13:33:58 -0700 > From: Philip Guenther > > On Sat, 10 Sep 2016, Mark Kettenis wrote: > > Seems the clang assembler ignores a .weak directive before the symbol is > > defined. > > > > ok? > > certainly. Thanks. Now the only issue seems to be:

Re: /usr/sbin/sysctl owner

2016-09-10 Thread Philip Guenther
On Sat, 10 Sep 2016, Philip Guenther wrote: > On Sat, 10 Sep 2016, Martin Natano wrote: > > Yet another symlink that belongs to root. Ok? > ... > > --- sbin/sysctl/Makefile4 May 2016 19:48:08 - 1.11 > > +++ sbin/sysctl/Makefile10 Sep 2016 18:05:09 - > > @@ -7,5 +7,6 @@

Re: /usr/sbin/sysctl owner

2016-09-10 Thread Philip Guenther
On Sat, 10 Sep 2016, Martin Natano wrote: > Yet another symlink that belongs to root. Ok? ... > --- sbin/sysctl/Makefile 4 May 2016 19:48:08 - 1.11 > +++ sbin/sysctl/Makefile 10 Sep 2016 18:05:09 - > @@ -7,5 +7,6 @@ CPPFLAGS+=-D_LIBKVM > > afterinstall: > ln

libm: don't use deprecated classification macros

2016-09-10 Thread Philip Guenther
fpclassify(3) says: The symbols isinff(), and isnanf() are provided as compatibility aliases to isinf(), and isnan(), respectively, and their uses are deprecated. Similarly, finite() and finitef() are deprecated versions of isfinite(). So let's use the preferred names in libm.

more clang libc fun

2016-09-10 Thread Mark Kettenis
Seems the clang assembler ignores a .weak directive before the symbol is defined. ok? Index: lib/libc/arch/amd64/sys/brk.S === RCS file: /cvs/src/lib/libc/arch/amd64/sys/brk.S,v retrieving revision 1.8 diff -u -p -r1.8 brk.S ---

Re: share/: install ownership fixes

2016-09-10 Thread Martin Natano
Another diff I typoed, also found by rpe@. Ok? Index: share/misc/pcvtfonts/Makefile === RCS file: /cvs/src/share/misc/pcvtfonts/Makefile,v retrieving revision 1.6 diff -u -p -r1.6 Makefile --- share/misc/pcvtfonts/Makefile 13

Re: sparc64: convert trap.c function defs from K to standard-style

2016-09-10 Thread Mark Kettenis
> Date: Sat, 10 Sep 2016 11:59:29 -0700 > From: Philip Guenther > > The functions here all have full prototypes in scope, so gcc is already > treating them as if they were standard-style definitions. While here, > s/__inline/inline/ as it's been 17 years since C99. > >

sparc64: convert trap.c function defs from K to standard-style

2016-09-10 Thread Philip Guenther
The functions here all have full prototypes in scope, so gcc is already treating them as if they were standard-style definitions. While here, s/__inline/inline/ as it's been 17 years since C99. ok? A warning for those doing these sorts of K -> standard conversions: beware of argument order

etc ownership fixes

2016-09-10 Thread Martin Natano
Diff below sets the owner for the /etc/localtime, /etc/rmt, /var/tmp and /sys symlinks and for the /var/sysmerge/etc.tgz tarball. This is the last of the noperm related pending M's in my tree. Ok? natano Index: etc/Makefile ===

Re: sparc64: delete 32bit process support from syscall()

2016-09-10 Thread Mark Kettenis
> Date: Sat, 10 Sep 2016 11:14:53 -0700 > From: Philip Guenther > > On Sat, 10 Sep 2016, Mark Kettenis wrote: > > ok kettenis@, but it is probably time to rewrite the comment above > > thie function as well. > > Like this? Yeah, nothing worth keeping in the bits you

Re: sparc64: delete 32bit process support from syscall()

2016-09-10 Thread Philip Guenther
On Sat, 10 Sep 2016, Mark Kettenis wrote: > ok kettenis@, but it is probably time to rewrite the comment above > thie function as well. Like this? Index: trap.c === RCS file: /cvs/src/sys/arch/sparc64/sparc64/trap.c,v retrieving

/usr/sbin/sysctl owner

2016-09-10 Thread Martin Natano
Yet another symlink that belongs to root. Ok? natano Index: sbin/sysctl/Makefile === RCS file: /cvs/src/sbin/sysctl/Makefile,v retrieving revision 1.11 diff -u -p -r1.11 Makefile --- sbin/sysctl/Makefile4 May 2016 19:48:08

mailwrapper symlinks owner

2016-09-10 Thread Martin Natano
Another set of symlinks, same drill: the owner should be root. Ok? natano Index: usr.sbin/mailwrapper/Makefile === RCS file: /cvs/src/usr.sbin/mailwrapper/Makefile,v retrieving revision 1.5 diff -u -p -r1.5 Makefile ---

mg docs ownership

2016-09-10 Thread Martin Natano
We should be explicit about owner/group when using install, so this also works correctly with noperm. Ok? natano Index: usr.bin/mg/Makefile === RCS file: /cvs/src/usr.bin/mg/Makefile,v retrieving revision 1.31 diff -u -p -r1.31

create /usr/share/calendar/$lang with root owner

2016-09-10 Thread Martin Natano
Currently the /usr/share/calendar/$lang directories are created with the build user as owner, but should be owned by root. Ok? natano Index: usr.bin/calendar/Makefile === RCS file: /cvs/src/usr.bin/calendar/Makefile,v retrieving

TXIC TX382B UART controller support

2016-09-10 Thread John Kelly
I'm not an OpenBSD user, I'm not asking for help. I'm posting here because OpenBSD was the only mention of this device I found when searching the net. My device also identifies as 0x4651 0x3273, though marked as PCI 60806 instead of TX382B. I never found a data sheet for it, but after some trial

Re: sparc64: clean up db_trace.c

2016-09-10 Thread Mark Kettenis
> Date: Fri, 9 Sep 2016 20:44:00 -0700 > From: Philip Guenther > > On Fri, 9 Sep 2016, Philip Guenther wrote: > > Noticed while looking at Jasper's diff. > > - convert declarations from k to standard C > > - delete support for 32bit frame backtracing. I doubt this code has

Re: reduce double caching in mfs

2016-09-10 Thread Theo de Raadt
> Isn't the solution to this problem a working dynamic buffer cache? I'm > not sure adding a hack for mfs, and the complexity that comes with it, > is the way to go. Did somebody analyzed what broke when the buffer > cache was cranked to 90%? My digging suggested that something on "write side"

Re: random malloc junk

2016-09-10 Thread Theo de Raadt
> On Thu, Sep 08, 2016 at 07:47:58PM -0400, Daniel Micay wrote: > > > A nice security property of 0xdf filling is that a use-after-free of a > > pointer is guaranteed to fault in a typical environment since it ends up > > pointing outside userspace (I assume that's the case on OpenBSD). A heap >

Re: Kernel panic pf.c during halting

2016-09-10 Thread Lampshade
My system don't started Tor daemon and dnscrypt-proxy daemon and still I get this kernel panic. I still use Unbound. I still have pf rules for transparent proxying. I only disabled Tor client. I was thinking about simplify more before I answer, but dhill () mindcry ! org posted similar bug to bug

iwm aux sta

2016-09-10 Thread Stefan Sperling
This removes unnecessary fluff from the AUX STA code and simplifies error handling around iwm_send_cmd_pdu_status() calls. While at it I spotted an uninitalized 'status' variable in iwm_add_int_sta_common() (note how iwm_send_cmd_pdu_status() won't always initialize *status). Index: if_iwm.c

Fix NFS hanging on shutdown/reboot

2016-09-10 Thread Tobias Ulmer
Pending NFS requests loop forever, blocking umount and not even allowing for clean shutdown/reboot. If you ever played with NFS for more than 30 seconds, you have run into this and had to press the reset button, followed by suffering through fsck... Pending requests occur because the NFS server

Re: random malloc junk

2016-09-10 Thread Otto Moerbeek
On Thu, Sep 08, 2016 at 07:47:58PM -0400, Daniel Micay wrote: > A nice security property of 0xdf filling is that a use-after-free of a > pointer is guaranteed to fault in a typical environment since it ends up > pointing outside userspace (I assume that's the case on OpenBSD). A heap > spray

gmtime return value

2016-09-10 Thread Carlin Bingham
If gmtime_r(3) fails it should return NULL, it currently returns a pointer to the unitialised tm struct it was given. -- Carlin Index: lib/libc/time/localtime.c === RCS file: /cvs/src/lib/libc/time/localtime.c,v retrieving

Fix an infinite loop in iked

2016-09-10 Thread Nikolay Edigaryev
This fixes a bug introduced in revision 1.8 of timer.c that causes evtimer_set() to be called on an already active event, which is an error according to event_add(3): >The event in the ev argument must be already initialized by event_set() >and may not be used in calls to event_set() until it has