installer - tar: Operation not permitted

2015-10-12 Thread Jean-Philippe Ouellet
While trying to make a fresh install with the from the Oct 12th miniroot58.fs, while installing the sets I get a bunch of: tar: Unable to set file uid/gid of ./blah/blah: Operation not permitted tar: Unable to set file uid/gid of ./...: Operation not permitted tar: Unable to set file uid/gid of

Re: Remove links to www@

2015-06-25 Thread Jean-Philippe Ouellet
On Thu, Jun 25, 2015 at 07:01:29AM +, Pavel Plamenov wrote: There are some leftover links to www@, which is gone. I sent an almost identical diff over a year ago: https://www.marc.info/?l=openbsd-miscm=139627200904849w=2 I think this is the right direction.

wc(1) SIGINFO - show count so far

2015-06-25 Thread Jean-Philippe Ouellet
SIGINFO is awesome, but it's even better when it actually does something relevant. This makes it print the total counts so far to stderr. Useful? Feature creep? You decide. Index: wc.c === RCS file: /cvs/src/usr.bin/wc/wc.c,v

Re: explicit_bzero in pkcs5_pbkdf2

2015-06-23 Thread Jean-Philippe Ouellet
I now realize this may have been ignored simply because the clock on the sending machine was horribly off and many people sort mail by date. So... Should this go in? Am I missing something? On Thu, Apr 30, 2015 at 06:03:23PM -0400, Jean-Philippe Ouellet wrote: The intermediate values calculated

Re: httpd rewrites with Lua's pattern matching

2015-06-23 Thread Jean-Philippe Ouellet
On Sat, Jun 20, 2015 at 03:01:18PM +0200, Reyk Floeter wrote: there is some great interest in getting support for rewrites What do people think of something like our tftpd(8)'s -r -r socket Issue filename rewrite requests to the specified UNIX domain socket. tftpd will

pkg_info: print used repos

2015-06-23 Thread Jean-Philippe Ouellet
This adds a -p option to pkg_info to show the PackageRepositorys being used. Inspired by trying to parse /etc/pkg.conf with some awk and quickly realized that was the wrong way to solve my problem. I then wrote some perl that reached into OpenBSD:: internals, but concluded it'd be much cleaner

PackageRepositoryList - kill dead code

2015-06-23 Thread Jean-Philippe Ouellet
This is no longer used anywhere, and even crashes if you try to call it. Besides, OpenBSD::PackageRepository::Source was removed almost a year ago. Index: PackageRepositoryList.pm === RCS file:

Remove broken and wrong PKG_PATH output from pkg_info -vQ

2015-06-23 Thread Jean-Philippe Ouellet
The idea was to print the package repository used followed by the stuff found in it, but that doesn't work: $ pkg_info -vQ foo Use of uninitialized value $ENV{PKG_PATH} in concatenation (.) or string at /usr/libdata/perl5/OpenBSD/PkgInfo.pm line 604. PKG_PATH= foo2zjs-20140627

Re: RAM encryption and key storing in CPU

2015-06-12 Thread Jean-Philippe Ouellet
The overhead is somewhat high, and it's considered broken anyway: https://www.acsac.org/2012/openconf/modules/request.php?module=oc_proceedingsaction=view.phpa=Acceptid=237type=4 P.S. Sorry for breaking threading, my mail setup is currently a mess.

explicit_bzero in pkcs5_pbkdf2

2015-06-10 Thread Jean-Philippe Ouellet
The intermediate values calculated in hmac_sha1 as part of pkcs5_pbkdf2 are not zeroed afterwards, so we leak a single-hashed version of the key on the stack in tk[]. Also, the correct RFC defining this is RFC 2104 - HMAC: Keyed-Hashing for Message Authentication not RFC 2202 - Test Cases

minor dd(1) posix-compliance

2015-03-16 Thread Jean-Philippe Ouellet
POSIX says the truncated things are record(s) not block(s): http://pubs.opengroup.org/onlinepubs/9699919799/utilities/dd.html That's what it's historically been too: http://minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/cmd/dd.c

sigaction.2 consistency

2014-09-14 Thread Jean-Philippe Ouellet
We use async-signal-safe (not async-signal safe) elsewhere, and so does POSIX. http://pubs.opengroup.org/onlinepubs/9699919799/functions/sigaction.html Index: sigaction.2 === RCS file: /cvs/src/lib/libc/sys/sigaction.2,v retrieving

Re: Refactoring process-local file descriptor data

2014-09-07 Thread Jean-Philippe Ouellet
, I just made sure it still built and that build built itself too. Capsicum is still blocking on this patch (or one like it). Any/all feedback welcome. On Thu, Jul 10, 2014 at 04:13:38PM -0400, Jean-Philippe Ouellet wrote: This diff adds another struct between filedesc and file to store process

Re: Refactoring process-local file descriptor data

2014-08-10 Thread Jean-Philippe Ouellet
Ping? On Sun, Jul 13, 2014 at 03:45:44PM -0400, Jean-Philippe Ouellet wrote: Updated for mallocarray() and free(size). On Thu, Jul 10, 2014 at 04:13:38PM -0400, Jean-Philippe Ouellet wrote: This diff adds another struct between filedesc and file to store process-local per-descriptor

Re: PATCH: overflow behavior in malloc(9)

2014-07-22 Thread Jean-Philippe Ouellet
On Mon, Jul 21, 2014 at 06:59:12AM +, Doug Hogan wrote: -objects and checks for arithmetic overflow. +objects and calls +.Xr panic 9 +on arithmetic overflow. That is misleading in the M_CANFAIL case. I'm not terribly good at wording things, but I suggest something more like this

Re: PATCH: further kernel malloc - mallocarray

2014-07-16 Thread Jean-Philippe Ouellet
For the cases where it's more than just nitems * sizeof(item), maybe it wouldn't be a bad idea to have something like: static __inline int MULT_OVERFLOWS(int x, int y) { const intmax_t max = 1UL sizeof(size_t) * 4; return ((x = max || y = max) x 0 SIZE_MAX / x y); } (or

const static - static const

2014-07-14 Thread Jean-Philippe Ouellet
The C standard mandates that static be first. From ISO/IEC 9899:1999 and 9899:201x, 6.11.5 - Storage-class specifiers: The placement of a storage-class specifier other than at the beginning of the declaration specifiers in a declaration is an obsolescent feature. and -Wextra

Re: const static - static const

2014-07-14 Thread Jean-Philippe Ouellet
On Mon, Jul 14, 2014 at 11:44:30AM -0400, Jean-Philippe Ouellet wrote: The C standard mandates that static be first. Of course I forgot something... This is the hunk that made me notice in the first place. Found while porting signify to osx. Index: lib/libc/hash/sha2.c

Re: improve srandomdev

2014-07-13 Thread Jean-Philippe Ouellet
On Sun, Jul 13, 2014 at 04:03:53PM +0200, Brent Cook wrote: On Jul 13, 2014, at 3:58 PM, Ted Unangst t...@tedunangst.com wrote: @@ -411,6 +404,9 @@ static long random_l(void) { int32_t i; + + if (use_arc4random) + return arc4random() 0x7fff; return

Re: mallocarray() in sys/dev, first pass

2014-07-13 Thread Jean-Philippe Ouellet
On Sun, Jul 13, 2014 at 11:29:22AM -0600, dera...@cvs.openbsd.org wrote: - ldp = malloc(sizeof(*ldp) + (k-1), M_DEVBUF, M_NOWAIT); + ldp = mallocarray(k-1, sizeof(*ldp), M_DEVBUF, M_NOWAIT); Are you sure k-1 can never be small enough such that a*b is less than a+b?

Re: mallocarray() in sys/dev, first pass

2014-07-13 Thread Jean-Philippe Ouellet
And some cosmetic things: Index: ic/malo.c - ring-data = malloc(count * sizeof (struct malo_rx_data), M_DEVBUF, - M_NOWAIT); + ring-data = mallocarray(count, sizeof (struct malo_rx_data), + M_DEVBUF, M_NOWAIT); Might as well s/sizeof (/sizeof(/ while you're here.

Re: Refactoring process-local file descriptor data

2014-07-13 Thread Jean-Philippe Ouellet
Updated for mallocarray() and free(size). On Thu, Jul 10, 2014 at 04:13:38PM -0400, Jean-Philippe Ouellet wrote: This diff adds another struct between filedesc and file to store process-local per-descriptor information. Currently, the only thing in this struct is the file pointer and some

getentropy.2 incorrect arg type

2014-07-13 Thread Jean-Philippe Ouellet
It takes a void *, not a char *. Index: getentropy.2 === RCS file: /cvs/src/lib/libc/sys/getentropy.2,v retrieving revision 1.4 diff -u -p -r1.4 getentropy.2 --- getentropy.215 Jun 2014 07:24:19 - 1.4 +++

Re: mallocarray(9)

2014-07-10 Thread Jean-Philippe Ouellet
On Thu, Jul 10, 2014 at 12:02:40PM -0700, Matthew Dempsky wrote: -.Fn malloc unsigned long size int type int flags +.Fn malloc size_t size int type int flags +.Ft void * +.Fn malloc size_t nmemb size_t size int type int flags 2nd one should be mallocarray.

Refactoring process-local file descriptor data

2014-07-10 Thread Jean-Philippe Ouellet
This diff adds another struct between filedesc and file to store process-local per-descriptor information. Currently, the only thing in this struct is the file pointer and some flags, however I have another patch on top of this that adds capsicum capabilities to it. (And another that uses

disklabel(8) n command default partition

2014-06-14 Thread Jean-Philippe Ouellet
Hi, When assigning mount points to an already-partitioned disk without a its fstab handy, it's annoying to type the partition letters one after another. (And sing the alphabet each time or look at the output of 'p' for letters after 'f'. I blame hex.) I could go back to preeschool and learn the

Re: mirrorlist file proposal

2014-06-09 Thread Jean-Philippe Ouellet
Eww... See distrib/notes/mirrors and installpath from pkg.conf(5).

Re: syncing libc and libkern

2014-06-05 Thread Jean-Philippe Ouellet
On Wed, Jun 04, 2014 at 08:02:06PM +, Miod Vallat wrote: First, str{cat,cpy} were vehemently expunged from the kernel many years ago, so stop trying to keep them around. Index: lib/libc/Makefile.inc Hello, this is libc you are butchering in. I'm afraid strcat and strcpy are still

syncing libc and libkern

2014-06-04 Thread Jean-Philippe Ouellet
Hello, This came up when I was looking for the proper place to put code for dealing with capsicum data structures which need to be handled by both userland and the kernel. FreeBSD's libc build system has tentacles that reach over and grab sys/kern/subr_capability.c. That's not very elegant, I

Re: USB suspend/resume race

2014-05-28 Thread Jean-Philippe Ouellet
On 26/05/14(Mon) 13:46, Martin Pieuchot wrote: I'd appreciate if people having troubles with suspend/resume could try this diff an report back. Fixes it for me! :D Many thanks. Previous diff was lacking the header chunk, please use this one instead. Was the corresponding commit missing the

gettytab(5) typo fix (and clearing console on (auto-)logout)

2014-05-23 Thread Jean-Philippe Ouellet
Found while trying to figure out how to be sure the console is always cleared at logout (and the resulting login prompt seemed like a pretty guaranteed-to-always-work place). If you have a cleaner way, perhaps one that is actually at logout and doesn't involve missing all the startup messages due

Re: PATCH: acpibat - expose capacity as sensor

2014-05-21 Thread Jean-Philippe Ouellet
todd, can you put this in snaps so that we know if there's some fallout? I don't know if this is related or not, but running that snap I experienced the following crash while trying to shut down: (which I've never had before) http://i.imgur.com/4YFzdv0.jpg http://i.imgur.com/KR1hWtT.jpg

make kernel build with EHCI_DEBUG

2014-05-16 Thread Jean-Philippe Ouellet
There are a bunch of nearby printfs which start with : ... without a devname. I'm not sure which one is preferred, so here's both ways. Index: ehci_cardbus.c === RCS file: /cvs/src/sys/dev/cardbus/ehci_cardbus.c,v retrieving

Re: malloc in libssl/src/apps

2014-05-05 Thread Jean-Philippe Ouellet
On Mon, May 05, 2014 at 07:31:34PM +1000, Joel Sing wrote: This one is calloc, not reallocarray, so unless I'm seriously missing something obvious here, it is indeed zero'd, no? Run the following before and after your change: Ah, yep. Can't believe I missed that (along with all the other

Re: malloc in libssl/src/apps

2014-05-04 Thread Jean-Philippe Ouellet
On Sun, May 04, 2014 at 12:17:16PM -0600, Theo de Raadt wrote: We are going to completely ignore diffs which change multiple idioms at once. Okay. That is how mistakes get made. Yep, more true than I realized. Here's a simpler one: Index: apps.c

Re: malloc in libssl/src/apps

2014-05-04 Thread Jean-Philippe Ouellet
On Sun, May 04, 2014 at 11:30:40PM +0200, Alexander Hall wrote: NULL theoretically could be != 0 Umm... short of something like: #undef NULL #define NULL I'm silly and want to break everything or something, I don't see when that'd be the case. According to ISO/IEC 9899:1999 TC3 (n1256)

Re: malloc in libssl/src/apps

2014-05-04 Thread Jean-Philippe Ouellet
On Mon, May 05, 2014 at 11:12:00AM +1000, Joel Sing wrote: - i = 0; if (arg-count == 0) { arg-count = 20; - arg-data = (char **)malloc(sizeof(char *) * arg-count); + arg-data = calloc(arg-count, sizeof(char *)); } - for (i = 0; i

warning building libcrypto on amd64

2014-04-25 Thread Jean-Philippe Ouellet
Hello, When building libcrypto on amd64 I get this warning: (cd /usr/src/lib/libcrypto/crypto/../../libssl/src/crypto/md5 ; /usr/bin/perl ./asm/md5-x86_64.pl openbsd-elf) md5-x86_64.S Use of uninitialized value $output in pattern match (m//) at ./asm/md5-x86_64.pl line 115. Admittedly it's

Re: libssl/src/apps don't cast {m,re}alloc

2014-04-23 Thread Jean-Philippe Ouellet
This doesn't fix the problems, only removes markers alerting us to audit it. Memory management in these files is still missing integer overflow checks, NULL return checks, and is full of crazy abominations like: X509_NAME * parse_name(char *subject, long chtype, int multirdn) { size_t

more axeing at openssl

2014-04-17 Thread Jean-Philippe Ouellet
Hi, Here's more fuel for the OpenSSL fire. Mostly just axeing at ifdefs, trying to err on the conservitive side. There's obviously *TONS* more to clean up, but I only had so much time tonight. :) BTW, libssl and libcrypto don't currently build because their Makefiles still include some

Re: lock(1) timeout message deduplication

2014-03-17 Thread Jean-Philippe Ouellet
Thank you very much for the feedback. On 3/14/14 9:38 AM, Ingo Schwarze wrote: According to the sigaction(3) manual, volatile sig_atomic_t would be better. If i understand correctly, overzealous compilers might otherwise optimize checks away. Dammit, of course. I should have caught that.

Re: GSoC proposal: Porting Capsicum to OpenBSD

2014-03-13 Thread Jean-Philippe Ouellet
On 3/12/14 11:15 PM, Loganaden Velvindron wrote: I've read about the file vulnerability, and capsicumization also came to mind. However, there was also a discussion when i was playing with capsicum and openssh, about the limits of capsicum. Capsicum doesn't prevent DoS, and we still need

Re: GSoC proposal: Porting Capsicum to OpenBSD

2014-03-13 Thread Jean-Philippe Ouellet
On 3/13/14 2:39 AM, Loganaden Velvindron wrote: I'm not a mentor, but I'd be happy to help you in any way I can. You can send mails to tech@ for testing your diffs. Any chance you'd like to review my bootloader patch from last month then? http://marc.info/?l=openbsd-techm=139408992902933 I

Re: GSoC proposal: Porting Capsicum to OpenBSD

2014-03-13 Thread Jean-Philippe Ouellet
On 3/13/14 3:18 AM, Loganaden Velvindron wrote: On 3/13/14 10:57 AM, Jean-Philippe Ouellet wrote: On 3/13/14 2:39 AM, Loganaden Velvindron wrote: I'm not a mentor, but I'd be happy to help you in any way I can. You can send mails to tech@ for testing your diffs. Any chance you'd like

Re: GSoC proposal: Porting Capsicum to OpenBSD

2014-03-12 Thread Jean-Philippe Ouellet
On 3/12/14 4:58 AM, tuchalia wrote: Hi all, I'm really interested in this possibility of porting the Capsicum framework to OpenBSD. Should l try to port also the Casper daemon to OpenBSD, or only work in the kernel implementation? I've used Capsicum during the last summer, but I only

Re: GSoC proposal: Porting Capsicum to OpenBSD

2014-03-12 Thread Jean-Philippe Ouellet
On 3/12/14 4:58 AM, tuchalia wrote: Also, do we have any IRC channel to discuss al this? I've been wondering about that too, although I was never really active on any of the channels. Mindcry is dead, subcult is mostly non-english, freenode and efnet are mostly whiners. I vaguely remember

lock(1) timeout message deduplication

2014-03-12 Thread Jean-Philippe Ouellet
Hello, When lock(1) receives SIGINT, SIGQUIT, or SIGTSTP, it calls hi() twice, once because it's the signal handler, and once after readpassphrase() errors because the read was interrupted. Since hi() gets called when readpassphrase() fails anyway, this patch ignores the signals instead of using

Re: GSoC proposal: Porting Capsicum to OpenBSD

2014-03-12 Thread Jean-Philippe Ouellet
On 3/12/14 4:58 AM, tuchalia wrote: Should l try to port also the Casper daemon to OpenBSD, or only work in the kernel implementation? Based on more private mail, I figured it'd be a good idea to make what I plan to work on public in case there are others interested so we can avoid stepping on

Re: lock(1) timeout message deduplication

2014-03-12 Thread Jean-Philippe Ouellet
On Wed, Mar 12, 2014 at 11:09:14PM +0100, Ingo Schwarze wrote: I don't really like the warnx(3) call from the bye() ALRM handler either, but that's a separate matter. Me neither. Maybe something like this instead? (although maybe the done check should be someplace else?) Index: lock.c

Re: [patch] sparc64 ofwboot.net manual config

2014-03-05 Thread Jean-Philippe Ouellet
do it, but I'm not sure what the cleanest approach would be. Any feedback is much appreciated. Original message with patch: http://marc.info/?l=openbsd-techm=139208386213686q=raw On 2/10/14 8:57 PM, Jean-Philippe Ouellet wrote: Hello, I patched the sparc64 bootloader to allow users

[patch] sparc64 ofwboot.net manual config

2014-02-10 Thread Jean-Philippe Ouellet
Hello, I patched the sparc64 bootloader to allow users to manually specify network config and where to load the kernel from via openfirmware parameters instead of always requiring rarp/bootparams/bootp. This enables remote bootstrapping of semi-recent sun boxes (like the T1000) on networks where

questions about boot-time entropy loading

2014-02-10 Thread Jean-Philippe Ouellet
Hello, While hacking on the sparc64 bootloader (patch in another mail) I had some questions about the recently added super-early entropy loading code. http://www.openbsd.org/cgi-bin/cvsweb/src/sys/arch/sparc64/stand/ofwboot/boot.c.diff?r1=1.19;r2=1.20 From the commit message: Try to load

Re: [patch] sparc64 ofwboot.net manual config

2014-02-10 Thread Jean-Philippe Ouellet
Here's some documentation of it for www/ I think there should also be some mention of this functionality in diskless(8), but I don't know where to put it, and I don't want to just .Xr it to boot_sparc64 because diskless is for all archs and none of the other boot_*s are referenced. Index:

ok to kill stdio.h in strsep.c?

2014-01-24 Thread Jean-Philippe Ouellet
It appeared in revision 1.3 (Update from lite2.) It's the only one in the string family that has it, and nothing from it is used. Index: strsep.c === RCS file: /cvs/src/lib/libc/string/strsep.c,v retrieving revision 1.6 diff -u -p

NSD manpage in mdoc

2010-08-23 Thread Jean-Philippe Ouellet
A few days ago I saw a commit for NSD, I had never heard of it before, so naturally, I went to read the manpage, however it wasn't there. I looked at the cvs tree, and saw that there was a manpage, just not formatted for mandoc like all other manpages I've seen in OpenBSD, so I read up on