libc: wrap for internal calls

2016-05-28 Thread Philip Guenther
alpha uses sysarch() to implement the floating-point control routines and mips64 uses sysarch() to implement cacheflush(). Let's provide lib/libc/hidden/machine/sysarch.h with the obvious contents so that those internal calls go directly to the syscall stub without possiblity of override or

libc/amd64: stop using sigblock/sigsetmask in setjmp/longjmp

2016-05-28 Thread Philip Guenther
This converts setjmp/longjmp and their sig* versions to use the sigprocmask syscall directly instead of the obsolete sigblock/sigsetmask APIs. No change in the results of the regress/lib/libc/*setjmp* tests. Ok? Philip Guenther Index: setjmp.S

prefer AF_* over PF_*

2016-05-28 Thread Philip Guenther
About the only place userland code should use PF_* socket constants is with sysctl(3)'s CTL_NET hierarchy. All the standardized functions are defined as taking AF_* values. Let's use the preferred names in the getaddrinfo(3) and socketpair(2) manpages. ok? Philip Guenther Index:

libc: delete unused hash algorithms

2016-05-28 Thread Philip Guenther
Overriding the hash algorithm used by the Berkeley DB bits isn't support (it would break getpw* if nothing else) and hasn't been possible since the symbol hiding effort last fall. So eliminate the redirection through a variable and declare it as a hidden function to eliminate the relocations

libc: declare hidden YP stuff as hidden

2016-05-28 Thread Philip Guenther
The _yp_bind() function and the _ypbindlist, _yp_domain, and _yplib_timeout variables are no longer exported in Symbols.list, so just declare them as hidden so they don't require GOT relocations. ok? Philip Guenther Index: yp/yp_bind.c

tunefs: remove pledge before opendev

2016-05-28 Thread Theo Buehler
In both code paths, openpartition() will call opendev after pledge was called. Just leave the "stdio" promise afterwards. Index: tunefs.c === RCS file: /var/cvs/src/sbin/tunefs/tunefs.c,v retrieving revision 1.40 diff -u -p -r1.40

ncheck_ffs and pledge disklabel

2016-05-28 Thread Theo Buehler
more of the same: $ ktrace ncheck_ffs /dev/tty Abort trap (core dumped) $ kdump | tail 65350 ncheck_ffs CALL open(0xd76b761d460,0) 65350 ncheck_ffs NAMI "/dev/tty" 65350 ncheck_ffs RET open 3 65350 ncheck_ffs CALL fstat(3,0x7f7ef100) 65350 ncheck_ffs STRU struct stat { dev=1040,

Re: growfs: hoist ioctl DIOCGDINFO over pledge disklabel

2016-05-28 Thread Bob Beck
Yeah, go for it! On Sat, May 28, 2016 at 2:14 PM, Theo Buehler wrote: > A slightly different beast: > > $ touch abcdabcdabcdabcd.a > $ ktrace growfs abcdabcdabcdabcd.a > Abort trap (core dumped) > $ kdump | tail > 63324 growfs CALL mprotect(0xe2b84265000,0x1000,0x1) >

Re: mklocale(1): ignore blanks after VARIABLE

2016-05-28 Thread Ingo Schwarze
Hi Jeremie, Jeremie Courreges-Anglas wrote on Sat, May 28, 2016 at 04:56:52PM +0200: > "Todd C. Miller" writes: >> Currently, mklocale only ignores the first blank after the VARIABLE >> definition. This means that we store the variable definition along >> with the

Re: mklocale(1): ignore blanks after VARIABLE

2016-05-28 Thread Ingo Schwarze
Hi Todd, Todd C. Miller wrote on Fri, May 27, 2016 at 04:37:18PM -0600: > Currently, mklocale only ignores the first blank after the VARIABLE > definition. This means that we store the variable definition along > with the leading blanks. > > The lexer should eat the blanks after VARIABLE

Re: sed/regcomp bug?

2016-05-28 Thread Martijn van Duren
Hello tech@, Here's part two of the sed fix. Here's part two of the sed fix. It applies the just added REG_NOTBOL|REG_STARTEND change to sed, so that begin of word matches directly after a previous match, ending in not a word, can match. It passes regress and an earlier version of this patch

ksh(1): Make PPID read-only

2016-05-28 Thread Anthony Coulter
The ksh(1) man page says that PPID should be a read-only variable. This diff makes that happen. It does not work to combine the two lines into "typeset -ir PPID" as the following session demonstrates: $ NUM=42 $ typeset -ir NUM ksh: NUM: is read only Curiously, I did this right the first

Re: growfs: hoist ioctl DIOCGDINFO over pledge disklabel

2016-05-28 Thread Theo de Raadt
Same story. Looks good. > A slightly different beast: > > $ touch abcdabcdabcdabcd.a > $ ktrace growfs abcdabcdabcdabcd.a > Abort trap (core dumped) > $ kdump | tail > 63324 growfs CALL mprotect(0xe2b84265000,0x1000,0x1) > 63324 growfs RET mprotect 0 > 63324 growfs CALL >

growfs: hoist ioctl DIOCGDINFO over pledge disklabel

2016-05-28 Thread Theo Buehler
A slightly different beast: $ touch abcdabcdabcdabcd.a $ ktrace growfs abcdabcdabcdabcd.a Abort trap (core dumped) $ kdump | tail 63324 growfs CALL mprotect(0xe2b84265000,0x1000,0x1) 63324 growfs RET mprotect 0 63324 growfs CALL

Re: Pledge failure in nc(1)

2016-05-28 Thread Bob Beck
committed.. Thanks Anthony! On Sat, May 28, 2016 at 09:58:55PM +0200, Theo Buehler wrote: > On Sat, May 28, 2016 at 01:47:22PM -0600, Bob Beck wrote: > > Nice catch, and the right analysis.. Thanks Anthony. I think that can > > be committed > > > > ok tb@ > > > I don't think we will get away

Re: ptrace PT_IO write bug

2016-05-28 Thread Mathieu -
Mark Kettenis wrote: > The thing you guys are missing is that on some architectures making changes > to instructions (PT_WRITE_I) requires some additional operations to > guarantee that the CPU actually sees those updated instructions. Typically > this is the case on architectures with separate

Re: [patch] netcat: don't call report_connect() when family == AF_UNIX

2016-05-28 Thread attila
Bob Beck writes: >> Hi tech@, >> >> I just ran into this while fiddling with some netcat-based plumbing. >> When I connect to the specified socket from another shell, the >> listening nc dies if it is AF_UNIX: >> >> $ tail -10f /var/log/messages | nc -vkU -l

Re: Pledge failure in nc(1)

2016-05-28 Thread Theo Buehler
On Sat, May 28, 2016 at 01:47:22PM -0600, Bob Beck wrote: > Nice catch, and the right analysis.. Thanks Anthony. I think that can > be committed > ok tb@ > I don't think we will get away from a bit of a maze there without > deprecating nc options, so > IMO this is fine. > > > On Sat, May 28,

Re: Pledge failure in nc(1)

2016-05-28 Thread Theo de Raadt
> When nc(1) tries to connect through an HTTP proxy that requires > authentication, nc calls readpassphrase(3) and aborts. Pledging "tty" > fixes this problem, but you'll notice that the diff has a lot of nasty > branches. My failure to check Pflag when connecting over unix sockets > is not an

Re: uvideo patches: Overview [0/4]

2016-05-28 Thread Marcus Glocker
On Fri, May 27, 2016 at 08:36:54AM +0200, Marcus Glocker wrote: > On Thu, May 26, 2016 at 04:18:58PM -0700, patrick keshishian wrote: > > > On Thu, May 26, 2016 at 10:55:47PM +0200, Marcus Glocker wrote: > > > On Tue, May 17, 2016 at 05:15:51PM -0700, patrick keshishian wrote: > > > > > > >

Re: Pledge failure in nc(1)

2016-05-28 Thread Bob Beck
Nice catch, and the right analysis.. Thanks Anthony. I think that can be committed I don't think we will get away from a bit of a maze there without deprecating nc options, so IMO this is fine. On Sat, May 28, 2016 at 12:36 PM, Anthony Coulter wrote: > When nc(1)

Pledge failure in nc(1)

2016-05-28 Thread Anthony Coulter
When nc(1) tries to connect through an HTTP proxy that requires authentication, nc calls readpassphrase(3) and aborts. Pledging "tty" fixes this problem, but you'll notice that the diff has a lot of nasty branches. My failure to check Pflag when connecting over unix sockets is not an oversight; nc

Re: fsck_msdofs and pledge disklabel

2016-05-28 Thread Sebastien Marie
ok semarie@ On Sat, May 28, 2016 at 07:33:25PM +0200, Theo Buehler wrote: > Another low hanging fruit of the same sort: > > $ ktrace fsck_msdofs /dev/tty > Abort trap (core dumped) > $ kdump | tail > 4663 fsck_msdos RET read 612/0x264 > 4663 fsck_msdos CALL read(3,0x304fdfe4000,0x4000) >

Re: iwm(4): Add support for Intel Wireless 3165

2016-05-28 Thread Stefan Sperling
On Sat, May 28, 2016 at 05:27:28PM +0200, Imre Vadasz wrote: > Hi, > > This adds support for the AC 3165 Intel wireless chipset. > Tested on a HP x2 210 tablet/detachable: > > iwm0 at pci1 dev 0 function 0 "Intel Dual Band Wireless AC 3165" rev 0x81, msi > iwm0: hw rev 0x210, fw ver 16.242414.0,

Re: [patch] netcat: don't call report_connect() when family == AF_UNIX

2016-05-28 Thread Bob Beck
if you write regress ill happily take them try to make a few for regular and tls connections and failures On Saturday, 28 May 2016, attila wrote: > > Bob Beck > writes: > > >> Hi tech@, > >> > >> I just ran into this while fiddling with

Re: [patch] netcat: don't call report_connect() when family == AF_UNIX

2016-05-28 Thread attila
Bob Beck writes: >> Hi tech@, >> >> I just ran into this while fiddling with some netcat-based plumbing. >> When I connect to the specified socket from another shell, the >> listening nc dies if it is AF_UNIX: >> >> $ tail -10f /var/log/messages | nc -vkU -l

Re: fsck_msdofs and pledge disklabel

2016-05-28 Thread Bob Beck
Another ok for this Although I am kind of wondering outloud is pledge disklabel is needed as such or could be refined.. should we simply always read the disklabel outside of pledge, and only need this to write one? On Sat, May 28, 2016 at 07:33:25PM +0200, Theo Buehler wrote: > Another low

Re: fsck_msdofs and pledge disklabel

2016-05-28 Thread Bob Beck
On Sat, May 28, 2016 at 11:45:38AM -0600, Bob Beck wrote: > Another ok for this > > Although I am kind of wondering outloud is pledge disklabel is needed as such > or could be refined.. should we simply always read the disklabel outside of > pledge, and only need this to write one? actually that

Re: ptrace PT_IO write bug

2016-05-28 Thread Mark Kettenis
Mathieu - schreef op 2016-05-28 13:05: Martin Natano wrote: The diff reads fine to me, however it is incomplete. There are some callers of process_domem() in arch/. They will need to be changed too. req seems to be in sync with uio_rw in all the cases, so just removing the last argument should

Re: [patch] netcat: don't call report_connect() when family == AF_UNIX

2016-05-28 Thread Bob Beck
> Hi tech@, > > I just ran into this while fiddling with some netcat-based plumbing. > When I connect to the specified socket from another shell, the > listening nc dies if it is AF_UNIX: > > $ tail -10f /var/log/messages | nc -vkU -l ~/.xlog_socket > nc: getnameinfo: Invalid argument >

fsck_msdofs and pledge disklabel

2016-05-28 Thread Theo Buehler
Another low hanging fruit of the same sort: $ ktrace fsck_msdofs /dev/tty Abort trap (core dumped) $ kdump | tail 4663 fsck_msdos RET read 612/0x264 4663 fsck_msdos CALL read(3,0x304fdfe4000,0x4000) 4663 fsck_msdos RET read 0 4663 fsck_msdos CALL open(0x3029c121880,0x2) 4663

Re: fsirand and pledge disklabel

2016-05-28 Thread Bob Beck
OK On Sat, May 28, 2016 at 07:02:44PM +0200, Theo Buehler wrote: > $ ktrace fsirand -p /altroot > Abort trap (core dumped) > $ kdump | tail >802 fsirand CALL pledge(0x16b2d3119a5e,0) >802 fsirand STRU pledge promise="stdio rpath wpath disklabel" >802 fsirand RET pledge 0 >

fsirand and pledge disklabel

2016-05-28 Thread Theo Buehler
$ ktrace fsirand -p /altroot Abort trap (core dumped) $ kdump | tail 802 fsirand CALL pledge(0x16b2d3119a5e,0) 802 fsirand STRU pledge promise="stdio rpath wpath disklabel" 802 fsirand RET pledge 0 802 fsirand CALL open(0x16b2d341f060,0) 802 fsirand NAMI "/altroot" 802

Re: Allow top(1) to search arguments (again)

2016-05-28 Thread Edd Barrett
On Wed, May 11, 2016 at 02:28:51PM +0200, Michal Mazurek wrote: > As discussed off list, "if (!term)" is redundant, as the caller does the > check. > > Also fix whitespace in some unrelated places. Can you split out the "term" change from style changes? You can do a KNF whack in a separate

Re: Pledge failure in disklabel(8)

2016-05-28 Thread Bob Beck
On Sat, May 28, 2016 at 10:02:27AM -0600, Theo de Raadt wrote: > fstat will not help: disklabel /dev/tty > Ok, apply against current and this does help. I've moved the readlabel() call before the pledge. ok? Index: disklabel.c

[patch] netcat: don't call report_connect() when family == AF_UNIX

2016-05-28 Thread attila
Hi tech@, I just ran into this while fiddling with some netcat-based plumbing. When I connect to the specified socket from another shell, the listening nc dies if it is AF_UNIX: $ tail -10f /var/log/messages | nc -vkU -l ~/.xlog_socket nc: getnameinfo: Invalid argument The attached

Re: Pledge failure in disklabel(8)

2016-05-28 Thread Theo de Raadt
fstat will not help: disklabel /dev/tty

Re: Pledge failure in disklabel(8)

2016-05-28 Thread Anthony Coulter
Oops, I did not check the return value of fstat. Good catch. But when I tested my change without yours, disklabel did not abort. Why then does opendev need to occur before the pledge? Is there another usage of disklabel that causes a different failure pattern? On 05/28/2016 11:31 AM, Theo

Re: Pledge failure in disklabel(8)

2016-05-28 Thread Theo de Raadt
> If you try to run disklabel(8) on a file that is not a device, it aborts > aborts for want of pledge("ioctl"). This diff prints an error message > and exits cleanly. I return exit code 1 but note that sometimes > disklabel returns 4; the man page doesn't explain the distinction > anywhere. > >

Re: rbootd: simplify signal handling

2016-05-28 Thread Theo de Raadt
Jeremie Courreges-Anglas writes: > ok ok deraadt also. > I doubt you'll get test reports. Shouldn't this kind of software be > moved to the ports tree, eventually? I fear that the percentage of > users that actually need rbootd is fairly small... Well, I dunno about moving it to ports. When

Re: Pledge failure in disklabel(8)

2016-05-28 Thread Bob Beck
On Sat, May 28, 2016 at 09:27:09AM -0600, Theo de Raadt wrote: > > If you try to run disklabel(8) on a file that is not a device, it aborts > > aborts for want of pledge("ioctl"). This diff prints an error message > > and exits cleanly. I return exit code 1 but note that sometimes > > disklabel

iwm(4): Add support for Intel Wireless 3165

2016-05-28 Thread Imre Vadasz
Hi, This adds support for the AC 3165 Intel wireless chipset. Tested on a HP x2 210 tablet/detachable: iwm0 at pci1 dev 0 function 0 "Intel Dual Band Wireless AC 3165" rev 0x81, msi iwm0: hw rev 0x210, fw ver 16.242414.0, address e0:94:67:bf:6f:76 Index: sys/dev/pci/if_iwm.c

Re: Pledge failure in disklabel(8)

2016-05-28 Thread Theo de Raadt
> If you try to run disklabel(8) on a file that is not a device, it aborts > aborts for want of pledge("ioctl"). This diff prints an error message > and exits cleanly. I return exit code 1 but note that sometimes > disklabel returns 4; the man page doesn't explain the distinction > anywhere. > >

Pledge failure in disklabel(8)

2016-05-28 Thread Anthony Coulter
If you try to run disklabel(8) on a file that is not a device, it aborts aborts for want of pledge("ioctl"). This diff prints an error message and exits cleanly. I return exit code 1 but note that sometimes disklabel returns 4; the man page doesn't explain the distinction anywhere. $ disklabel

Re: rbootd: simplify signal handling

2016-05-28 Thread Jeremie Courreges-Anglas
Philip Guenther writes: > Actually, the signal handling was simplified 14(!) years ago by miod@ when > he changed rbootd to do all processing from its main loop, with signals > just setting flags tested there. This diff just removes the blocking and > unblocking that was

Re: mklocale(1): ignore blanks after VARIABLE

2016-05-28 Thread Jeremie Courreges-Anglas
"Todd C. Miller" writes: > Currently, mklocale only ignores the first blank after the VARIABLE > definition. This means that we store the variable definition along > with the leading blanks. > > The lexer should eat the blanks after VARIABLE before storing the >

[patch]: httpd: extend "include" to support glob(3) patterns.

2016-05-28 Thread Fabian Raetz
Hi, the patch below teaches httpd's "include" keyword how to handle file patterns via glob(3) by introducing a new function "pushglob()". This allows something like the following in httpd.conf: include "/etc/httpd/sites-enabled/*.conf" If the pattern passed to pushglob() contains no

Re: rcmdsh(3): use getaddrinfo() not gethostbyname2()

2016-05-28 Thread Jeremie Courreges-Anglas
"Todd C. Miller" writes: > rmcd(3) was converted ages ago but apparently this was missed. ok jca@ Note that the manpage still refers to gethostbyname(3). -- jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE

Re: ptrace PT_IO write bug

2016-05-28 Thread Jeremie Courreges-Anglas
Mathieu - writes: > Martin Natano wrote: >> The diff reads fine to me, however it is incomplete. There are some >> callers of process_domem() in arch/. They will need to be changed too. >> req seems to be in sync with uio_rw in all the cases, so just removing >> the last

Re: ptrace PT_IO write bug

2016-05-28 Thread Mathieu -
Martin Natano wrote: > The diff reads fine to me, however it is incomplete. There are some > callers of process_domem() in arch/. They will need to be changed too. > req seems to be in sync with uio_rw in all the cases, so just removing > the last argument should do it. > Thanks for the

Re: rcmdsh(3): use getaddrinfo() not gethostbyname2()

2016-05-28 Thread Florian Obser
OK florian@ On Fri, May 27, 2016 at 06:09:40PM -0600, Todd C. Miller wrote: > rmcd(3) was converted ages ago but apparently this was missed. > > - todd > > Index: lib/libc/net/rcmdsh.c > === > RCS file:

Re: MBIM Patch - Part 1 of 4

2016-05-28 Thread Stuart Henderson
On 2016/05/28 09:18, Stefan Sperling wrote: > Could mbim in theory support IPv6? The MBIM spec allows for it. > Don't worry about breaking existing umsm(4) setups. > Since this driver provides a much simpler user interface than umsm coupled > with pppd(8) I'd suggest to eventually prefer

Re: ptrace PT_IO write bug

2016-05-28 Thread Martin Natano
On Fri, May 27, 2016 at 10:15:39PM +0200, Jeremie Courreges-Anglas wrote: > Mathieu - writes: > > > Hello everyone, > > > > While playing a bit with ptrace to do some debugging I stumbled upon > > something that looks like a bug. > > While trying to write to the ptrace'd

Re: iwm(4): The valid_{rx,tx}_ant values only be read from nvm for 8000 family

2016-05-28 Thread Stefan Sperling
On Thu, May 26, 2016 at 05:30:07PM +0200, Imre Vadasz wrote: > Hi, > > We only need to set the data->valid_tx_ant and data->valid_rx_ant > values in iwm_parse_nvm_data() for the 8000 family chips. > This matches what iwl_set_radio_cfg() in iwl-nvm-parse.c from Linux's > iwlwifi does. > > Also

Re: MBIM Patch - Part 1 of 4

2016-05-28 Thread Stefan Sperling
On Mon, May 23, 2016 at 03:54:36PM +0200, Martin Pieuchot wrote: > I'd like to bikeshed early, we're trying to prefix all new USB driver > name with 'u'. So I'd suggest a rename when this goes in tree. umb(4) ("USB Mobile Broadband") is available.

Re: MBIM Patch - Part 1 of 4

2016-05-28 Thread Stefan Sperling
On Mon, May 23, 2016 at 03:37:32PM +0200, Gerhard Roth wrote: > I have this stuff around quite a while now, but since patrick@ asked > me repeatedly, I think it is time to share this now. > > This is a patch that adds support for the "Mobile Broadband Interface > Model" (MBIM) from

Re: replace bpf open loops

2016-05-28 Thread Martin Natano
On Fri, May 27, 2016 at 10:03:37PM +0200, Jeremie Courreges-Anglas wrote: > Martin Natano writes: > > > I think it's time to get rid of all the bpf open() loops in base. > > dhclient and libpcap do a plain open("/dev/bpf0", ...) since a couple of > > weeks now and the upgrade