Re: mount(8): strlen + malloc + snprintf == asprintf

2016-09-04 Thread Otto Moerbeek
On Mon, Sep 05, 2016 at 08:05:40AM +0300, Ali H. Fardan wrote: > On 2016-09-05 08:01, David Gwynne wrote: > > > On 5 Sep 2016, at 12:13, Ali H. Fardan wrote: > > > > > > You can't specify a buffer size in asprintf() therefore, it is not > > > secure, > > > you can see that snprintf() does write

Re: mount(8): strlen + malloc + snprintf == asprintf

2016-09-04 Thread Ali H. Fardan
On 2016-09-05 08:01, David Gwynne wrote: On 5 Sep 2016, at 12:13, Ali H. Fardan wrote: You can't specify a buffer size in asprintf() therefore, it is not secure, you can see that snprintf() does write to the `i` bytes to the buffer asprintf allocates the memory it needs to write to, unlike

Re: mount(8): strlen + malloc + snprintf == asprintf

2016-09-04 Thread David Gwynne
> On 5 Sep 2016, at 12:13, Ali H. Fardan wrote: > > You can't specify a buffer size in asprintf() therefore, it is not secure, > you can see that snprintf() does write to the `i` bytes to the buffer asprintf allocates the memory it needs to write to, unlike snprintf which requires a preallocat

usr.bin/fgen/fgen.l - ANSIfy

2016-09-04 Thread Sevan Janiyan
Hello, Attached patch removes the K&R style function & main() prototype. Sevan Index: usr.bin/fgen/fgen.l === RCS file: /cvs/src/usr.bin/fgen/fgen.l,v retrieving revision 1.12 diff -u -p -r1.12 fgen.l --- usr.bin/fgen/fgen.l 9 Oct 20

Drop main() prototype

2016-09-04 Thread Sevan Janiyan
Hello, Attached patches remove the main() prototype from src/{sbin,usr.bin,usb.sbin} Next sweep will be to mark usage() as static __dead. Sevan Index: usr.bin/cap_mkdb/cap_mkdb.c === RCS file: /cvs/src/usr.bin/cap_mkdb/cap_mkdb.c,v

Remove /usr/share/misc/eqnchar

2016-09-04 Thread Anthony J. Bentley
Hi, eqnchar is a collection of eqn(7) definitions to create mathematical symbols by constructing them from other characters. Creating circled plus with O, a backspace, and a plus, for example. The results are quite ugly in both mandoc and groff if it even works at all. Nothing in base (or even an

Re: mount(8): strlen + malloc + snprintf == asprintf

2016-09-04 Thread Ali H. Fardan
You can't specify a buffer size in asprintf() therefore, it is not secure, you can see that snprintf() does write to the `i` bytes to the buffer Raiz Original Message Subject: mount(8): strlen + malloc + snprintf == asprintf Date: 2016-09-04 19:47 From: Michal Mazurek To: tec

syslogd validate client certificates

2016-09-04 Thread Alexander Bluhm
Hi, Add an option to give syslogd a server CA that is used to validate client certificates. This prevent that malicious clients can send fake messages. ok? bluhm Index: usr.sbin/syslogd/syslogd.8 === RCS file: /data/mirror/openbsd

Re: Sync getopt with getopt

2016-09-04 Thread Todd C. Miller
On Sun, 04 Sep 2016 11:58:23 -0600, "Anthony J. Bentley" wrote: > This brings /usr/share/misc/getopt in sync with the example in getopt(3). OK, though I wonder if anyone actually looks at this file? - todd

Re: remove usermount remnants

2016-09-04 Thread Ted Unangst
Martin Natano wrote: > usermount is dead. Ok? ok

remove usermount remnants

2016-09-04 Thread Martin Natano
usermount is dead. Ok? natano Index: lib/libc/gen/sysctl.3 === RCS file: /cvs/src/lib/libc/gen/sysctl.3,v retrieving revision 1.267 diff -u -p -r1.267 sysctl.3 --- lib/libc/gen/sysctl.3 20 Jul 2016 09:15:28 - 1.267 ++

Re: iwm ioctl rwlock

2016-09-04 Thread Ted Unangst
Stefan Sperling wrote: > Replace the ioctl tsleep/wakeup BUSY flag dance with an rwlock. This does the same change for the other intel wifi drivers. Mechanical change, but I don't have hardware to test. Index: if_ipw.c === RCS file:

iwm ioctl rwlock

2016-09-04 Thread Stefan Sperling
Replace the ioctl tsleep/wakeup BUSY flag dance with an rwlock. ok? Index: if_iwm.c === RCS file: /cvs/src/sys/dev/pci/if_iwm.c,v retrieving revision 1.124 diff -u -p -r1.124 if_iwm.c --- if_iwm.c4 Sep 2016 17:01:59 - 1

a few more sparcles

2016-09-04 Thread Ted Unangst
a few sparc references sprinkled about in dev Index: ic/com.c === RCS file: /cvs/src/sys/dev/ic/com.c,v retrieving revision 1.160 diff -u -p -r1.160 com.c --- ic/com.c3 Sep 2016 14:43:37 - 1.160 +++ ic/com.c4 Sep 201

Sync getopt with getopt

2016-09-04 Thread Anthony J. Bentley
Hi, This brings /usr/share/misc/getopt in sync with the example in getopt(3). ok? Index: getopt === RCS file: /cvs/src/share/misc/getopt,v retrieving revision 1.8 diff -u -p -r1.8 getopt --- getopt 1 Feb 2006 09:27:28 -

mount(8): strlen + malloc + snprintf == asprintf

2016-09-04 Thread Michal Mazurek
do what tb@ did for hexdump Index: sbin/mount/mount.c === RCS file: /cvs/src/sbin/mount/mount.c,v retrieving revision 1.66 diff -u -p -r1.66 mount.c --- sbin/mount/mount.c 26 Jun 2016 19:53:40 - 1.66 +++ sbin/mount/mount.c

Re: Watchdog and ifp detach races

2016-09-04 Thread Mike Belopuhov
On 4 September 2016 at 17:43, Martin Pieuchot wrote: > Thanks to awolk@ hacking on USB wireless we found a lot of new races in > the network stack. > > Passing and ``ifp'' pointer to a task is *not* safe. If the task > sleeps, then another thread my start executing if_detach() freeing the > memor

Re: hexdump(1): strlen + calloc + snprintf == asprintf

2016-09-04 Thread Bob Beck
ok beck@ On Sun, Sep 4, 2016 at 9:54 AM, Theo Buehler wrote: > use the libc interface instead of rolling it by hand. > > Index: parse.c > === > RCS file: /var/cvs/src/usr.bin/hexdump/parse.c,v > retrieving revision 1.21 > diff -u -p

Re: Watchdog and ifp detach races

2016-09-04 Thread Alexander Bluhm
On Sun, Sep 04, 2016 at 05:43:20PM +0200, Martin Pieuchot wrote: > So we should always pass and ifp index like I did with the > if_input_process() task. Diff attached fix awolk@'s first panic. > > ok? OK bluhm@ > mq_init(&ifp->if_inputqueue, 8192, IPL_NET); > - task_set(ifp->if_inputt

OpenCVS: missing getpw pledge

2016-09-04 Thread Theo Buehler
The pledge can probably be improved a bit, but I'm not going to do this in this disabled code. However, cvs is calling getpwuid() all over the place, so the getpw promise should probably be added to this initial annotation. Index: cvs.c

Re: Another step in cleaning the smtpd exit path.

2016-09-04 Thread Gilles Chehade
On Sun, Sep 04, 2016 at 05:02:07PM +0200, Eric Faurot wrote: > > The smtpd processes are not expected to ever leave their event loop. > So stop pretending that the *_shutdown() functions could ever be called > in this context, and just fatal() if event_dispatch() returns. > ok > Index: ca.c > =

hexdump(1): strlen + calloc + snprintf == asprintf

2016-09-04 Thread Theo Buehler
use the libc interface instead of rolling it by hand. Index: parse.c === RCS file: /var/cvs/src/usr.bin/hexdump/parse.c,v retrieving revision 1.21 diff -u -p -r1.21 parse.c --- parse.c 24 Aug 2016 03:13:45 - 1.21 +++ pars

Re: Watchdog and ifp detach races

2016-09-04 Thread Claudio Jeker
On Sun, Sep 04, 2016 at 05:43:20PM +0200, Martin Pieuchot wrote: > Thanks to awolk@ hacking on USB wireless we found a lot of new races in > the network stack. > > Passing and ``ifp'' pointer to a task is *not* safe. If the task > sleeps, then another thread my start executing if_detach() freeing

Watchdog and ifp detach races

2016-09-04 Thread Martin Pieuchot
Thanks to awolk@ hacking on USB wireless we found a lot of new races in the network stack. Passing and ``ifp'' pointer to a task is *not* safe. If the task sleeps, then another thread my start executing if_detach() freeing the memory associated to ``ifp''. And task do sleep, that's why we use t

Re: Another step in cleaning the smtpd exit path.

2016-09-04 Thread Sunil Nimmagadda
On Sun, Sep 04, 2016 at 05:02:07PM +0200, Eric Faurot wrote: > > The smtpd processes are not expected to ever leave their event loop. > So stop pretending that the *_shutdown() functions could ever be called > in this context, and just fatal() if event_dispatch() returns. > > Eric. Ok sunil@

Re: Another step in cleaning the smtpd exit path.

2016-09-04 Thread Giovanni Bechis
On Sun, Sep 04, 2016 at 05:02:07PM +0200, Eric Faurot wrote: > > The smtpd processes are not expected to ever leave their event loop. > So stop pretending that the *_shutdown() functions could ever be called > in this context, and just fatal() if event_dispatch() returns. > make sense, ok giovann

Another step in cleaning the smtpd exit path.

2016-09-04 Thread Eric Faurot
The smtpd processes are not expected to ever leave their event loop. So stop pretending that the *_shutdown() functions could ever be called in this context, and just fatal() if event_dispatch() returns. Eric. Index: ca.c === RCS fi

Re: Bridge broken in 6.0?

2016-09-04 Thread Ted Unangst
Aaron Riekenberg wrote: > Based on Martin's hint I tried an experiment - I configured em0 statically > instead of using dhcp. This fixes my problem. > > So to summarize: in 6.0 running dhclient on a bridge-member interface > breaks dhcp traffic passing through the bridge. This worked in 5.9. Al

Re: realloc -> reallocarray in vmstat

2016-09-04 Thread Philip Guenther
On Sun, Sep 4, 2016 at 2:58 PM, Theo Buehler wrote: > I was told there was no particular reason to use realloc here. > This is basically a sed job: Looks right; assuming it runs, ok guenther@

realloc -> reallocarray in vmstat

2016-09-04 Thread Theo Buehler
I was told there was no particular reason to use realloc here. This is basically a sed job: Index: dkstats.c === RCS file: /var/cvs/src/usr.bin/vmstat/dkstats.c,v retrieving revision 1.38 diff -u -p -r1.38 dkstats.c --- dkstats.c 24

Re: Futexes for OpenBSD

2016-09-04 Thread Mark Kettenis
> Date: Sun, 4 Sep 2016 15:17:21 +0200 > From: Michal Mazurek > > Resending a diff that works with the current tree. > > Comments? I believe it was said before, but this can't go in since it breaks architectures that don't implement the __sync_xxx primitives. > Index: sys/conf/files >

Use rdaemon() in ftp-proxy

2016-09-04 Thread Jeremie Courreges-Anglas
Similar diff for ftp-proxy: we can return a proper exit status if we can't drop privs (eg missing _ftp_proxy user). Index: ftp-proxy.c === RCS file: /cvs/src/usr.sbin/ftp-proxy/ftp-proxy.c,v retrieving revision 1.34 diff -u -p -p -u

[patch] inter-phone: Fix Belarus

2016-09-04 Thread Vadim Vygonets
Hello OŭpenBiEsDzi, In r1.11 ("belorussia, rodina moya"), someone misspelled the country name. To keep the theme of silly commit messages for this file, I propose "Žyvie Biełaruś" (possibly without diacritics). Vadzik. -- Question Authority -- and the authorities will question you. (K) Index:

Re: Futexes for OpenBSD

2016-09-04 Thread Michal Mazurek
Resending a diff that works with the current tree. Comments? Index: sys/conf/files === RCS file: /cvs/src/sys/conf/files,v retrieving revision 1.627 diff -u -p -r1.627 files --- sys/conf/files 4 Sep 2016 09:22:28 - 1.6

Use rdaemon() in dhclient

2016-09-04 Thread Jeremie Courreges-Anglas
dhclient already uses the same pattern as rdaemon(), let's sync the implementation. No functional change intended, the extra safety check for devnull > 2 is a bonus. Index: dhclient.c === RCS file: /cvs/src/sbin/dhclient/dhclient.c

Bridge broken in 6.0?

2016-09-04 Thread Aaron Riekenberg
Based on Martin's hint I tried an experiment - I configured em0 statically instead of using dhcp. This fixes my problem. So to summarize: in 6.0 running dhclient on a bridge-member interface breaks dhcp traffic passing through the bridge. This worked in 5.9. Also the FAQ bridge example uses DHC

Fwd: Bridge broken in 6.0?

2016-09-04 Thread aaron . riekenberg
Forwarding to tech. On Saturday, 3 September 2016 08:36:43 UTC-5, aaron.ri...@gmail.com wrote: > > On Saturday, 3 September 2016 07:15:27 UTC-5, Martin Pieuchot wrote: > > Yes something changed. That might be the cause for your regression. > > Sadly your bug report does not contain enough infor

Use rdaemon() in dhcrelay

2016-09-04 Thread Jeremie Courreges-Anglas
(Needs a fresh dhcrelay.c) Using rdaemon(), we can delay going in the background 'til very late, that is after the chroot. Thanks to this we can catch errors like a missing _dhcp user or /var/empty directory, by returning a proper exit status. (Also, thanks to the log_perror approach in dhcrela

Re: Fix Wacom Intuos S 2 descriptor and make wsmouse work

2016-09-04 Thread Martin Pieuchot
On 09/03/16 20:15, Frank Groeneveld wrote: On Wed, Aug 10, 2016 at 03:42:34PM +0200, Martin Pieuchot wrote: I'd ignore it as a first step, then revisit this later. Attached a first stab at a seperate driver. Some points of interest: - I've decided against using a custom hid descriptor, but in

Re: sxidog hang

2016-09-04 Thread Mark Kettenis
> Date: Sun, 4 Sep 2016 13:20:30 +0200 > From: Marcus Glocker > > On Fri, Sep 02, 2016 at 10:22:26AM +0200, Mark Kettenis wrote: > > > > Date: Fri, 2 Sep 2016 08:31:20 +0200 > > > From: Marcus Glocker > > > > > > Trying to disable the watchdog on the allwinner,sun5i-r8 breaks the > > > reboot

Re: sxidog hang

2016-09-04 Thread Marcus Glocker
On Fri, Sep 02, 2016 at 10:22:26AM +0200, Mark Kettenis wrote: > > Date: Fri, 2 Sep 2016 08:31:20 +0200 > > From: Marcus Glocker > > > > Trying to disable the watchdog on the allwinner,sun5i-r8 breaks the > > reboot ('reboot failed; spinning'). Can we change this back at least > > for the A10?

Re: [PATCH] Callback-based interface to libtls

2016-09-04 Thread Bob Beck
On Sun, Sep 04, 2016 at 05:26:24AM -0500, Brent Cook wrote: > On Sun, Sep 04, 2016 at 05:57:54AM -0400, Ted Unangst wrote: > > Brent Cook wrote: > > > @@ -246,14 +252,18 @@ An already existing socket can be upgrad > > > .Fn tls_connect_socket . > > > Alternatively, a secure connection can be est

Re: [PATCH] Callback-based interface to libtls

2016-09-04 Thread Brent Cook
On Sun, Sep 04, 2016 at 05:57:54AM -0400, Ted Unangst wrote: > Brent Cook wrote: > > @@ -246,14 +252,18 @@ An already existing socket can be upgrad > > .Fn tls_connect_socket . > > Alternatively, a secure connection can be established over a pair of > > existing > > file descriptors by calling

Re: Remove tape block device support

2016-09-04 Thread Philip Guenther
On Sun, Sep 4, 2016 at 11:11 AM, Christian Weisgerber wrote: > This removes support for tape BLOCK devices from the kernel. > > (Since people were confused: Everything you typically do with tapes, > like dump/restore, tar, mt, etc. uses character devices and is not > affected by this. You would o

Re: [PATCH] Callback-based interface to libtls

2016-09-04 Thread Bob Beck
On Sun, Sep 04, 2016 at 05:57:54AM -0400, Ted Unangst wrote: > Brent Cook wrote: > > @@ -246,14 +252,18 @@ An already existing socket can be upgrad > > .Fn tls_connect_socket . > > Alternatively, a secure connection can be established over a pair of > > existing > > file descriptors by calling

Remove tape block device support

2016-09-04 Thread Christian Weisgerber
This removes support for tape BLOCK devices from the kernel. (Since people were confused: Everything you typically do with tapes, like dump/restore, tar, mt, etc. uses character devices and is not affected by this. You would only use a block device to mount(8) a tape.) Anything I missed? OK?

Re: [PATCH] Callback-based interface to libtls

2016-09-04 Thread Ted Unangst
Brent Cook wrote: > @@ -246,14 +252,18 @@ An already existing socket can be upgrad > .Fn tls_connect_socket . > Alternatively, a secure connection can be established over a pair of existing > file descriptors by calling > -.Fn tls_connect_fds . > +.Fn tls_connect_fds . Using > +.Fn tls_connect_c

Re: [PATCH] Callback-based interface to libtls

2016-09-04 Thread Brent Cook
On Sun, Jul 17, 2016 at 01:32:43PM +0200, Tobias Pape wrote: > Hi all, > > I'm Tobias and fond of using libtls. > I have a certain use case, where I want to do TLS/SSL but > can only work with buffers/callbacks and not sockets or FDs. > In p(l)ain openssl, this is doable, but not nice. Libtls > doe

Re: openssl s_time error with -time option

2016-09-04 Thread Philip Guenther
On Sun, Sep 4, 2016 at 9:32 AM, Kinichiro Inoguchi wrote: > openssl s_time command gets "invalid seconds argument for -time". > I think options_parse() should increment i for OPTION_ARG_TIME, too. > I attached the patch for this issue. > > Sorry, now I am trying to learn about /usr/src source tree

openssl s_time error with -time option

2016-09-04 Thread Kinichiro Inoguchi
Hi, openssl s_time command gets "invalid seconds argument for -time". I think options_parse() should increment i for OPTION_ARG_TIME, too. I attached the patch for this issue. Sorry, now I am trying to learn about /usr/src source tree and cvs, still. Then this patch is made from git repo of libre

regen pkg-config files

2016-09-04 Thread Martin Natano
Currently we regenerate the pkg-config files on every install. Following patch allows to only regen the files when the library version changed. Ok? natano Index: lib/libcrypto/Makefile === RCS file: /cvs/src/lib/libcrypto/Makefile,