better implementation of malloc option C: canaries

2016-10-02 Thread Otto Moerbeek
Hi, I have been working on a diff to do canaries in a better way. Canaries (enabled by the C malloc option) are values stored after the requested size that are checked for being overwritten on calling free(3). At the moment we only do this for chunks (sub-page sized allocations). To be able to

Re: Explicitly cast the return variable in tls_load_file()

2016-10-02 Thread kinichiro inoguchi
Thanks, that is apparently better than I suggested and reasonable. And I confirmed it can also avoid the issue. I appreciate if this is applied. And, yes I believe compilation error is bug of compiler, not source code. I posted this compilation error to Intel C++ compiler forum on Sunday.

Re: Explicitly cast the return variable in tls_load_file()

2016-10-02 Thread Ted Unangst
Brent Cook wrote: > ​Why not just make the variable type match the return type to begin with? sure, that's reasonable. > > ​--- a/src/lib/libtls/tls_util.c > +++ b/src/lib/libtls/tls_util.c > @@ -105,7 +105,8 @@ tls_load_file(const char *name, size_t *len, char > *password) > FILE *fp;

Re: syslogd fork+exec

2016-10-02 Thread Alexander Bluhm
On Sat, Oct 01, 2016 at 07:41:13PM +0200, Rafael Zalamena wrote: > This could be replaced with "closefrom(4);". Updated diff: - use closefrom(2) - use execvp(3) to allow starting syslogd(8) without full path - add a debug message to make testing easier ok? bluhm Index:

ntpd(8): use safer dup3() instead of dup2()

2016-10-02 Thread Rafael Zalamena
This diff is an improvement and an attempt to fix the bug where the ntpd(8) not always stays running. During the review of syslogd fork+exec diff I noticed the use of dup3() and went to read its man page: dup2() doesn't always remove the CLOEXEC flag from the descriptor, so using dup3() is a

bridge(4): use hook to notify interface detach

2016-10-02 Thread Rafael Zalamena
Just like the switch(4) diff, this one does the same thing for the bridge(4). This diff removes bridge(4) code from if.c and uses the detach hook to be notified about interface removals. ok? Index: net/if.c === RCS file:

switch(4): use hook to notify interface detach

2016-10-02 Thread Rafael Zalamena
mpi@ suggested that it would be possible to use if_detachhooks to handle the interface teardown instead of adding code to if.c, so this diff does exactly that. Not only we get to remove switch(4) code from if.c, we also get less lines of code by removing some duplicated teardown procedure in

Re: stricter sys_mount() flag handling

2016-10-02 Thread Alexander Bluhm
On Sat, Oct 01, 2016 at 06:01:34PM +0200, Martin Natano wrote: > After committing the new MNT_NOPERM flag I got some complaints that my > code doesn't work by people that recompiled mount_ffs, but didn't reboot > to the new kernel. I don't blame them; in that situation sys_mount() > silently

Re: clang, stack limit and inlining

2016-10-02 Thread Mark Kettenis
> From: "Theo de Raadt" > Date: Fri, 30 Sep 2016 09:38:30 -0600 > > > Diff below is a possible way to fix this. But in a way we're cheating > > here since we'll still consume more than 2047 bytes of stack space > > when we descend into wskbd_initmute(). So perhaps we

printf("%s", NULL) in make(1)

2016-10-02 Thread Theo Buehler
Found a bunch of these in my /var/log/messages: Oct 2 18:30:58 idefix make: vfprintf %s NULL in "Applying :%c to "%s" " Oct 2 18:30:58 idefix make: vfprintf %s NULL in "Result is "%s" " To reproduce, issue 'make -n -d v' in a simple port, e.g. sysutils/cpuid Index: usr.bin/make/varmodifiers.c

larger bus width for ommmc(4)

2016-10-02 Thread Jonathan Gray
Only set the highspeed bit in bus_clock if highspeed is supported by the controller. Needed as the bus_clock callback is called with SDMMC_TIMING_HIGHSPEED even if the capability is not set. Required to raise the bus width on pandaboard which doesn't have the highspeed capability. As anything

Re: Explicitly cast the return variable in tls_load_file()

2016-10-02 Thread Brent Cook
On Sat, Oct 1, 2016 at 7:12 PM, Ted Unangst wrote: > Kinichiro Inoguchi wrote: > > I would like to cast the return variable explicitly in tls_load_file(). > > This fix also avoiding Intel C++ compiler "assertion failed" described > here. > >

Re: EVP_CipherFinal_ex for snmpd

2016-10-02 Thread Brent Cook
ok On Sun, Oct 2, 2016 at 12:34 AM, David Gwynne wrote: > this gets rid of a linker warning. > > the impression i get is that EVP_CipherFinal_ex explicitely does > not do cleanup of the cipher context thing, while EVP_CipherFinal > could if it wanted to. > > ok? > > Index:

pending timeouts in trpt

2016-10-02 Thread David Gwynne
i think the change to move tcp timers to timeouts got this bit wrong. we do want to print the timer if it is pending, it doesnt make sense otherwise. ok? Index: trpt.c === RCS file: /cvs/src/usr.sbin/trpt/trpt.c,v retrieving

Re: make snmpd explicitely include tree.h

2016-10-02 Thread Philip Guenther
On Sat, Oct 1, 2016 at 11:58 PM, David Gwynne wrote: > at the moment its relying on a pf header. > > ok? ok guenther@ ...though the set of #includes in that .h file should be reviewed: lots of the .c file there pull in net/if.h, so why is snmpd.h doing so, etc.

Re: share/misc: Complete 'airport' and 'inter.phone' for Poland

2016-10-02 Thread Raf Czlonka
On Sat, Oct 01, 2016 at 11:00:07PM BST, Frederic Cambus wrote: > Hi tech@, > > This diff adds missing airports and area codes for Poland, and fixes > some erroneous entries. Hi Frederic, I've been meaning to do it for a while - thanks! :^) A couple of comments below. Cheers, Raf > OK? > >

make snmpd explicitely include tree.h

2016-10-02 Thread David Gwynne
at the moment its relying on a pf header. ok? Index: snmpd.h === RCS file: /cvs/src/usr.sbin/snmpd/snmpd.h,v retrieving revision 1.67 diff -u -p -r1.67 snmpd.h --- snmpd.h 16 Aug 2016 18:41:57 - 1.67 +++ snmpd.h 2