Re: Linker changes between 5.7 and 5.8

2015-12-04 Thread Stefan Kempf
Tati Chevron wrote: > This assembled and linked without problems on 5.7-release, but now when > I try it on 5.8-release, I get an error: > > $ as -o charset.o charset.S > $ ld -Bstatic charset.o > ld: charset.o: relocation R_X86_64_32S against `a local symbol' can not > be used when making a sha

[trivial] strings.h -> string.h in tcpdump

2015-12-04 Thread Michael McConville
Otherwise it warns about memcpy being implicitly declared. ok? Index: print-l2tp.c === RCS file: /cvs/src/usr.sbin/tcpdump/print-l2tp.c,v retrieving revision 1.8 diff -u -p -r1.8 print-l2tp.c --- print-l2tp.c16 Jan 2015 06:4

Re: __progname in base

2015-12-04 Thread Michael McConville
Tobias Stoeckmann wrote: > Opinions, thoughts? > > > [...] > > > > Index: sbin/newfs/newfs.c > > === > > RCS file: /cvs/src/sbin/newfs/newfs.c,v > > retrieving revision 1.100 > > diff -u -p -u -p -r1.100 newfs.c > > --- sbin/newfs/ne

Re: libc: getusershell, new implementation

2015-12-04 Thread Philip Guenther
On Fri, Dec 4, 2015 at 2:54 PM, Tobias Stoeckmann wrote: > On Fri, Dec 04, 2015 at 03:47:07PM -0700, Theo de Raadt wrote: >> > Is it worth it, knowing that it's a deprecated BSD-specific function? >> >> Careful there :-) It isn't deprecated in the BSD's, and it isn't >> deprecated in any other sys

Re: Linker changes between 5.7 and 5.8

2015-12-04 Thread Tati Chevron
ld ignores the -fno-pie option and produces the same error. Presumably it's because I'm trying to build a static executable. I've tried passing every option I can think of to ld, but I can't work it out. The output from the assembler is fine, can be linked on a machine running 5.7, and the resu

Re: libc: getusershell, new implementation

2015-12-04 Thread Tobias Stoeckmann
On Fri, Dec 04, 2015 at 03:47:07PM -0700, Theo de Raadt wrote: > > Is it worth it, knowing that it's a deprecated BSD-specific function? > > Careful there :-) It isn't deprecated in the BSD's, and it isn't > deprecated in any other system which is still doing maintainance and > improvements to it.

Re: Linker changes between 5.7 and 5.8

2015-12-04 Thread Theo de Raadt
Most architectures went to 'static PIE' by default in 5.8. You will probably need something like -fno-pie. The entire exercise of writing asm which bootstraps without the c runtime means you are very much on your own. > This assembled and linked without problems on 5.7-release, but now when > I

Re: libc: getusershell, new implementation

2015-12-04 Thread Theo de Raadt
> That is not true with the new code, and should be avoided IMHO. If this > implementation encounters a line that does not start with a slash '/', > it will be discarded. Maybe we should adjust the manual page to be more > precise? I'm happy to see the new strictness. Maybe tigthen the manual pag

Re: __progname in base

2015-12-04 Thread Tobias Stoeckmann
Opinions, thoughts? Joerg Sonnenberger mentioned that getprogname() could be used. On Sat, Nov 07, 2015 at 12:20:42PM +0100, Tobias Stoeckmann wrote: > Based on Todd's patch for at and cron, I did a grep through our base > tree to see if there are more occurrences of self-made __progname > handli

Linker changes between 5.7 and 5.8

2015-12-04 Thread Tati Chevron
This assembled and linked without problems on 5.7-release, but now when I try it on 5.8-release, I get an error: $ as -o charset.o charset.S $ ld -Bstatic charset.o ld: charset.o: relocation R_X86_64_32S against `a local symbol' can not be used when making a shared object; recompile with -fPIC c

libc: getusershell, new implementation

2015-12-04 Thread Tobias Stoeckmann
There's still a possible overflow in getusershell.c. We could increase the buffer allocation yet again, but I have to agree with the glibc developers here: enough is enough. The code is ugly and has proven to be difficult to review. The overflow has been spotted by Paul Pluzhnikov, after I submitt

Re: libc: locale/rune.c input validation

2015-12-04 Thread Tobias Stoeckmann
Hi Ingo, On Fri, Dec 04, 2015 at 12:27:39PM +0100, Ingo Schwarze wrote: > uint32_t should be preferred because that's the POSIX type, while > u_int32_t is not standardized. If you are working on the file > anyway, i'd recommend to unify all uses to uint32_t. done. > __LP64__ that is overly spec

Re: npppd: simplify and lock down priv_open()

2015-12-04 Thread YASUOKA Masahiko
On Fri, 4 Dec 2015 09:47:46 -0800 Philip Guenther wrote: > On Fri, Dec 4, 2015 at 3:41 AM, YASUOKA Masahiko wrote: >> On Sat, 10 Oct 2015 21:32:29 -0700 >> Philip Guenther wrote: >>> So: >>> * kill the 'mode' argument to PRIVSEP_OPEN and priv_open() >>> * fail a PRIVSEP_OPEN call if it's pass

Re: npppd: simplify and lock down priv_open()

2015-12-04 Thread Todd C. Miller
On Fri, 04 Dec 2015 09:47:46 -0800, Philip Guenther wrote: > We should fix open(2); please try the diff below. Are you sure pppx > is affected? pppxioctl()'s FIONBIO case appears to be a no-op. I > certainly agree that bpf and tun are affected. Shouldn't the device open function check for FNON

Re: npppd: simplify and lock down priv_open()

2015-12-04 Thread Philip Guenther
On Fri, Dec 4, 2015 at 3:41 AM, YASUOKA Masahiko wrote: > On Sat, 10 Oct 2015 21:32:29 -0700 > Philip Guenther wrote: >> So: >> * kill the 'mode' argument to PRIVSEP_OPEN and priv_open() >> * fail a PRIVSEP_OPEN call if it's passed any flags other than >>O_ACCMODE or O_NONBLOCK >> * parano

Re: Make ix(4) mpsafe: take 2

2015-12-04 Thread Hrvoje Popovski
On 4.12.2015. 12:47, Mark Kettenis wrote: > Here is a new diff to make ix(4) mpsafe. Should now longer get stuck > in the OACTIVE state. Tests more than welcome. > Hi, i have tested this patch with 82599 and x540 while sending 6Mpps for cca 3 hours and ifconfig down/up and everything is worki

Do not grab the KERNEL_LOCK() in rtalloc(9)

2015-12-04 Thread Martin Pieuchot
To reduce contention in the fast path we can use a mutex(9) to serialize read/write operations on the radix tree instead of the KERNEL_LOCK. Note that the KERNEL_LOCK is still needed to serialize walk/delete/insert because a call to rtable_delete() can be made inside rtable_walk(), and we cannot u

Re: rc.d/rebound: check for rebound.conf

2015-12-04 Thread Antoine Jacoutot
On Fri, Dec 04, 2015 at 01:41:55PM +0100, Christian Weisgerber wrote: > Require /etc/rebound.conf to exist before starting rebound. > > Otherwise, if the configuration file doesn't exist, rebound will > error out, but only after daemonizing, so the rc system won't notice > the failure. > > ok? I

Re: UTF-8 support for wc(1)

2015-12-04 Thread Ingo Schwarze
Hi Todd, Todd C. Miller wrote on Thu, Dec 03, 2015 at 11:40:55AM -0700: > On Sun, 29 Nov 2015 17:45:55 +0100, Ingo Schwarze wrote: >> our wc(1) utility currently violates POSIX in two ways: >> >> 1. The -m option counts bytes instead of characters. >> The patch given below fixes that. >> >

rc.d/rebound: check for rebound.conf

2015-12-04 Thread Christian Weisgerber
Require /etc/rebound.conf to exist before starting rebound. Otherwise, if the configuration file doesn't exist, rebound will error out, but only after daemonizing, so the rc system won't notice the failure. ok? Index: rebound === RC

Re: introducing ip_send()/ip6_send() to OpenBSD kernel

2015-12-04 Thread Alexandr Nedvedicky
On Thu, Dec 03, 2015 at 11:00:09PM +0100, Thierry Deval wrote: > Hello Sasha, > > You kept the static prototypes for ip_send_dispatch and > ip6_send_dispatch. > > You'd better avoid mixing static and non-static declarations for the same > functions. ;-) > bluhm sitting next to me spot it too.

Make ix(4) mpsafe: take 2

2015-12-04 Thread Mark Kettenis
Here is a new diff to make ix(4) mpsafe. Should now longer get stuck in the OACTIVE state. Tests more than welcome. Index: if_ix.c === RCS file: /cvs/src/sys/dev/pci/if_ix.c,v retrieving revision 1.129 diff -u -p -r1.129 if_ix.c --

Re: npppd: simplify and lock down priv_open()

2015-12-04 Thread YASUOKA Masahiko
Hi, On Sat, 10 Oct 2015 21:32:29 -0700 Philip Guenther wrote: > So: > * kill the 'mode' argument to PRIVSEP_OPEN and priv_open() > * fail a PRIVSEP_OPEN call if it's passed any flags other than >O_ACCMODE or O_NONBLOCK > * paranoia: mask O_CREAT when calling open() with only two arguments

Re: libc: locale/rune.c input validation

2015-12-04 Thread Ingo Schwarze
Hi Tobias, Tobias Stoeckmann wrote on Thu, Dec 03, 2015 at 11:08:28PM +0100: > Ingo Schwarze wrote: >> I would suggest to use uint32_t. > Just while applying this, I noticed that the file has a mix of the > types u_int32_t and uint32_t. I took u_int32_t for now because it was > in there more oft

Re: introducing ip_send()/ip6_send() to OpenBSD kernel

2015-12-04 Thread Martin Pieuchot
On 04/12/15(Fri) 20:45, David Gwynne wrote: > > On 4 Dec 2015, at 7:36 PM, Martin Pieuchot wrote: > > On 04/12/15(Fri) 12:38, David Gwynne wrote: > >>> On 4 Dec 2015, at 06:44, Alexandr Nedvedicky > >>> wrote: > >> [...] > >> it might be better to add the task to systq instead of &softnettq. if

Re: bridge_output() and KERNEL_LOCK

2015-12-04 Thread Mark Kettenis
> Date: Fri, 4 Dec 2015 11:48:57 +0100 > From: Martin Pieuchot > > Now that if_start() will take the KERNEL_LOCK itself if the driver is > not marked as IFXF_MPSAFE if_enqueue() is almost mpsafe. > > The missing piece is addressed by the diff below. We want to ensure > bridge_output() is calle

Re: bridge_output() and KERNEL_LOCK

2015-12-04 Thread David Gwynne
ok > On 4 Dec 2015, at 8:48 PM, Martin Pieuchot wrote: > > Now that if_start() will take the KERNEL_LOCK itself if the driver is > not marked as IFXF_MPSAFE if_enqueue() is almost mpsafe. > > The missing piece is addressed by the diff below. We want to ensure > bridge_output() is called with

ARP input path without KERNEL_LOCK

2015-12-04 Thread Martin Pieuchot
Now that in_arpinput() only uses the routing table, if_get()/if_put() and carp_iamatch being already mpsafe we can kill the ARP input queue. This moves the ARP input path processing from the softnet interrupt context (under KERNEL_LOCK) to the sofnettask (without KERNEL_LOCK). ok? Index: net/if_

Re: introducing ip_send()/ip6_send() to OpenBSD kernel

2015-12-04 Thread David Gwynne
> On 4 Dec 2015, at 7:36 PM, Martin Pieuchot wrote: > > On 04/12/15(Fri) 12:38, David Gwynne wrote: >> >>> On 4 Dec 2015, at 06:44, Alexandr Nedvedicky >>> wrote: >>> >>> Hello, >>> >>> below is final patch I'm going to commit. Summary of changes: >>> - softnettq declaration moved to ne

bridge_output() and KERNEL_LOCK

2015-12-04 Thread Martin Pieuchot
Now that if_start() will take the KERNEL_LOCK itself if the driver is not marked as IFXF_MPSAFE if_enqueue() is almost mpsafe. The missing piece is addressed by the diff below. We want to ensure bridge_output() is called with the KERNEL_LOCK() held. ok? Index: net/if.c

Re: relayd patch - delayed failover

2015-12-04 Thread Brian S. Vangsgaard
i believe i committed the correct one, i just replied to the wrong mail here on the list. Here is what i put in: http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.sbin/relayd/pfe.c.diff?r1=1.82&r2=1.83&sortby=date /Benno Correct, thank you. Sebastian Benoit skrev den 2015-12-03 17:43: >t

Re: introducing ip_send()/ip6_send() to OpenBSD kernel

2015-12-04 Thread Martin Pieuchot
On 04/12/15(Fri) 12:38, David Gwynne wrote: > > > On 4 Dec 2015, at 06:44, Alexandr Nedvedicky > > wrote: > > > > Hello, > > > > below is final patch I'm going to commit. Summary of changes: > > - softnettq declaration moved to net/if_var.h (by bluhm@) > > - lock order swapped: KERNEL_

Re: relayd patch - delayed failover

2015-12-04 Thread Sebastian Benoit
Brian S. Vangsgaard(b...@avalanic.dk) on 2015.12.04 09:04:19 +0100: > Hi Sebastian > > You commited the wrong patch. > > Please see http://marc.info/?l=openbsd-tech&m=144378086813524&w=2 > > The patch below, results in a relayd panic if more than one host is > available in the group. i believe

Re: relayd patch - delayed failover

2015-12-04 Thread Brian S. Vangsgaard
Hi Sebastian You commited the wrong patch. Please see http://marc.info/?l=openbsd-tech&m=144378086813524&w=2 The patch below, results in a relayd panic if more than one host is available in the group. Sebastian Benoit skrev den 2015-12-03 17:43: thanks, commited Brian S. Vangsgaard(b...@aval