spec_vnops.c uiomove() conversion

2016-01-13 Thread Martin Natano
Below the conversion to uiomove() for kern/spec_vnops.c. This diff prevents truncation of uio_resid when passed to min(). Index: kern/spec_vnops.c === RCS file: /cvs/src/sys/kern/spec_vnops.c,v retrieving revision 1.84 diff -u -p -u -

ppp_tty uiomove() conversion

2016-01-13 Thread Martin Natano
Below the uiomove() conversion for net/ppp_tty.c. M_TRAILINGSPACE() returns int, but the result can't be negative, so using u_int for the return value should be fine. Index: net/ppp_tty.c === RCS file: /cvs/src/sys/net/ppp_tty.c,v ret

tty uiomove() conversion

2016-01-13 Thread Martin Natano
Below the conversion from uiomovei() to uiomove() for kern/tty.c and kern/tty_pty.c. 'cc' consistently contains small, non-negative integer values, so leaving the type as int should be ok. It could as well be changed to size_t, but I don't see a benefit in doing so for that particular case, except

Re: tmpfs uiomove() conversion

2016-01-17 Thread Martin Natano
Stefan Kempf wrote: > I'm a bit uneasy though with passing signed values as-is to uiomove(). > Can we somehow make it explicit that we know that the uiomove() argument is > >= 0? > > Changing types all over the place would be too much churn though. > > I'm leaning towards an explicit size_t cast

Re: [patch] ls + utf-8 support

2016-01-17 Thread Martin Natano
I agree with Ingo, ls(1) shouldn't generate unsafe output. Regardless of whether the output is to a terminal or some other file. cheers, natano

vmctl create nit-picks

2016-01-19 Thread Martin Natano
Hi, below some comments regarding the vmctl disk image creation code. Index: main.c === RCS file: /cvs/src/usr.sbin/vmctl/main.c,v retrieving revision 1.13 diff -u -p -u -r1.13 main.c --- main.c 5 Jan 2016 16:25:34 - 1

udf uiomove() conversion

2016-01-20 Thread Martin Natano
Below the conversion to uiomove() for isofs/udf/. Note that converting size to size_t is not possible in udf_read(), as udf_readatoffset() requires a pointer to an integer variable. Changing that would cause a lot of code churn, so i chose to truncate uio_resid to INT_MAX instead. udf_readatoffset(

msdosfs uiomove() conversion

2016-01-21 Thread Martin Natano
Below the uiomove() conversion for msdosfs. This diff prevents truncation of uio_resid in both msdosfs_read() and msdosfs_write(). Index: msdosfs/msdosfs_vnops.c === RCS file: /cvs/src/sys/msdosfs/msdosfs_vnops.c,v retrieving revision

Re: Use uiomove() in if_tun and if_pppx

2016-01-23 Thread Martin Natano
For what it's worth, your diff reads fine to me. It took me a while to realize, that tlen in pppxwrite() and tun_dev_write() can't overflow because of the range check beforehand, but on close look that code also turns out to be correct. cheers, natano On Fri, Jan 22, 2016 at 07:29:54PM +0100, St

Re: Firefox, malloc(3) and threads

2016-01-23 Thread Martin Natano
Yes! This absolutely makes Youtube videos watchable for me (on a Thinkpad T520). There still is occassional stuttering, but _far_ less disruptive than before. Another usecase where I see improvements is reloading a resource-heavy web page while switching tabs. Before applying the patch, this caused

bktr uiomove() conversion

2016-01-24 Thread Martin Natano
Below the conversion from uiomovei() to uiomove() for bktr. The patch also replaces two occurrences of uio->uio_iov->iov_len with uio->uio_resid. I don't see a reason why bktr should inspect iov_len directly. Index: dev/pci/bktr/bktr_core.c =

Re: udf uiomove() conversion

2016-01-27 Thread Martin Natano
On Wed, Jan 27, 2016 at 06:26:00AM +0100, Stefan Kempf wrote: > Martin Natano wrote: > > Below the conversion to uiomove() for isofs/udf/. Note that converting > > size to size_t is not possible in udf_read(), as udf_readatoffset() > > requires a pointer to an integer variable

Signed overflow in ufs i_modrev calculation

2016-01-27 Thread Martin Natano
In ufs, the calculation of i_modrev can produce signed overflow on 32 bit architectures (found on i386). The tv.tv_usec * 4294 calculation is designed to move the microseconds part of a struct timeval to the upper bits of an unsigned(!) 32 bit value to make room for simple i_modrev increments, but

Re: Signed overflow in ufs i_modrev calculation

2016-01-27 Thread Martin Natano
On Wed, Jan 27, 2016 at 12:27:46PM +0100, Mike Belopuhov wrote: > On 27 January 2016 at 09:52, Martin Natano wrote: > > In ufs, the calculation of i_modrev can produce signed overflow on 32 > > bit architectures (found on i386). The tv.tv_usec * 4294 calculation is > >

nfs uiomove() conversion

2016-01-27 Thread Martin Natano
Below the uiomove() conversion for nfs. I didn't change the type of 'n' to be size_t, because it never exceeds the maximum rpc size (nm_rsize), which is an integer too. (Also, to avoid unnecessary code churn.) Index: nfs/nfs_bio.c ===

ntfs uiomove() conversion

2016-01-31 Thread Martin Natano
Below the conversion to uiomove() for ntfs. In the first three hunks the size passed to uiomove(i) already was of type size_t. I also converted the 'left' variable in ntfs_readattr() to size_t, because it tracks the remainder of 'rsize', which also is size_t. Index: ntfs/ntfs_subr.c ==

undefined behaviour in add_entropy_words()

2016-01-31 Thread Martin Natano
Hi, The add_entropy_words() function performs a right shift by (32 - entropy_input_rotate) bits, with entropy_input_rotate being an integer between [0..31]. This can lead to a shift of 32 on a 32 bit value, which is undefined behaviour in C. The standard says this: "If the value of the right opera

Re: ntfs uiomove() conversion

2016-02-02 Thread Martin Natano
On Tue, Feb 02, 2016 at 07:30:08PM +0100, Stefan Kempf wrote: > Looks good. I agree with changing left to size_t. One small remark > though: size_t is defined as unsigned long. Do the DPRINTFs that print > the value of left have to be changed to use %zu in the format string? Said DDPRINTFs are in f

Re: Add APM_IOC_HIBERNATE to apm.4

2016-02-02 Thread Martin Natano
> The following patch adds documentation for the APM_IOC_HIBERNATE ioctl > to the manual pages. There was a typo in the zaurus hunk. Updated diff below. Index: share/man/man4/man4.amd64/apm.4 === RCS file: /cvs/src/share/man/man4/ma

Re: [patch] kern/exec_script: return error when the shell name is not specified

2016-02-06 Thread Martin Natano
I think that 'cp += shellarglen + 1;' is a dead store. The 'cp' variable is not used anymore after that line. Either way your diff reads fine to me! natano > Index: sys/kern/exec_script.c > === > RCS file: /cvs/src/sys/kern/exec_scr

ufs/ffs/ext2fs uiomove() conversion

2016-02-07 Thread Martin Natano
Below the conversion to uiomovei() for ufs. While there I changed all instances of 'blkoffset', 'size' and 'xfersize' that where declared as long integers to be plain integers instead for consistency with the surrounding code. These variables are limited by fs_bsize and e2fs_bsize respectively, whi

Re: ufs/ffs/ext2fs uiomove() conversion

2016-02-08 Thread Martin Natano
> One unrelated thing noted while reviewing: > > ufs/ext2fs/ext2fs_readwrite.c: > static int > ext2_ind_read(struct vnode *vp, struct inode *ip, struct m_ext2fs *fs, > struct uio *uio) > { > ... > > if (vp->v_type == VLNK) { > if ((int)ext2fs_size(ip) < vp->v_mount->

Re: Int overflow in diff(1), rcs(1), cvs(1)

2016-02-10 Thread Martin Natano
On Wed, Feb 10, 2016 at 09:29:26AM -0700, Todd C. Miller wrote: > On Wed, 10 Feb 2016 08:36:42 -0700, "Todd C. Miller" wrote: > > > Making those values unsigned int should be sufficient but it is a > > fairly intrusive change. > > Actually, this is trickier than it appears since diff uses the sig

diff -e: mishandling of bare dots

2016-02-13 Thread Martin Natano
When diff encounters a line that consists of a single dot, it emits two dots instead, stops the current command and emits a substitute command to replace the double dot with a single one. Then it restarts the (original) command if necessary and inserts further lines. This is done because a single d

Re: httpd patterns double free

2016-02-14 Thread Martin Natano
On Thu, Feb 11, 2016 at 03:50:24PM +0100, Alexander Schrijver wrote: > I ran into this issue when setting up my public_html folder using this > configuration. > > prefork 2 > > server "default" { >listen on * port 80 > >location match "/~*" { > root "/users" >} > } > > types

fusefs_checkexp() return value

2016-02-16 Thread Martin Natano
The fusefs_checkexp() function returns 0, indicating that export via NFS is allowed, while in fact fusefs doesn't support NFS at all. (There is a vfs_export() call missing in fusefs_mount() and maybe other stuff too.) Furthermore, it does so without setting *extflagsp and *credanonp, which results

fusefs_fhtovp() falsely rejects root file handle

2016-02-16 Thread Martin Natano
The fusefs_fhtovp() function makes use of the ROOTINO ((ufsino_t)2) define instead of using FUSE_ROOTINO ((ino_t)1), which is used everywhere else in the fuse filesystem. This causes a file handle for the filesystem root to be falsely rejected with ESTALE. Comments? Index: miscfs/fuse/fuse_vfsops

Harmful casts in ufs

2016-02-17 Thread Martin Natano
Casting the result of ext2fs_size() and DIP(ip, size) to int potentially truncates the result. Issue found by Stefan Kempf, see https://marc.info/?l=openbsd-tech&m=145495905416536 . While there I also removed the cast in the ext2fs_chmod() call, because the function expects a mode_t argument anywa

Re: Harmful casts in ufs

2016-02-17 Thread Martin Natano
On Wed, Feb 17, 2016 at 11:27:29AM -0700, Todd C. Miller wrote: > On Wed, 17 Feb 2016 10:22:04 +0100, Martin Natano wrote: > > > Casting the result of ext2fs_size() and DIP(ip, size) to int potentially > > truncates the result. Issue found by Stefan Kempf, see > > http

Re: undefined behaviour in add_entropy_words()

2016-02-19 Thread Martin Natano
On Thu, Feb 18, 2016 at 09:11:18PM +0100, Stefan Kempf wrote: > > I think we don't mix declarations and code. > Would this be an option? > > diff --git a/dev/rnd.c b/dev/rnd.c > index 819ce0d..0f57b1b 100644 > --- a/dev/rnd.c > +++ b/dev/rnd.c > @@ -421,7 +421,7 @@ add_entropy_words(const u_int3

Re: Harmful casts in ufs

2016-02-21 Thread Martin Natano
On Wed, Feb 17, 2016 at 11:27:29AM -0700, Todd C. Miller wrote: > There is currently code that checks for mnt_maxsymlinklen <= 0. > Removing the cast will cause other problems for ffs if the maxsymlinklen > value is negative. I don't think it is safe to make this change > unless mnt_maxsymlinklen

Re: diff -e: mishandling of bare dots

2016-02-21 Thread Martin Natano
> Hmm, something still does not seem right. For example, try > diff -e on the contents below (some other tests attached): > > A > B > C > > vs. > > W > X > . > Y > Z > > [...] > > About the changes below, is something like this the idea behind it? > The first change command has already removed

patch -e reorders line on multiline insert

2016-02-21 Thread Martin Natano
When inserting multiple lines with the insert or change command the lines get reordered when the file is empty before inserting. e.g. following ed script produces incorrect output (apply to a file with three lines in it). 1,3c x y z . The expected order of lines would be, x, y, z but patch produ

ed-style diff intuit in patch

2016-02-21 Thread Martin Natano
patch(1) doesn't recognize ed-style diffs that start with an insert command as such. Same holds true for substitution command, but with the current state of support for s/, I don't think it makes sense to support diffs starting with s/.//. Thoughts? natano Index: pch.c =

Re: Harmful casts in ufs

2016-02-22 Thread Martin Natano
On Mon, Feb 22, 2016 at 06:31:00AM -0700, Todd C. Miller wrote: > On Sun, 21 Feb 2016 16:33:27 +0100, Stefan Kempf wrote: > > > Should we really mount the FS in that case? If the FS was of the > > "new" format, then short symlinks would store the destination path in the > > inode directly. I think

stale entries for RAIDframe in chrtoblktbl

2016-02-25 Thread Martin Natano
For most architectures there still is an entry for the removed RAIDframe device lurking in chrtoblktbl. While there I truncated the tables to the minimum required size; chrtoblk() and blktochr() are designed to handle a table shorter than cdevsw. Ok? natano Index: arch/alpha/alpha/conf.c ==

Re: move mnt_maxsymlinklen to struct ufsmount

2016-02-26 Thread Martin Natano
. natano On Fri, Feb 26, 2016 at 11:32:08PM +0100, Martin Natano wrote: > The concept of differentiating between "short" and "long" symlinks is > specific to ufs/, but the relevant variable is contained in struct > mount, which is used by all filesystems. I think it wou

Re: move mnt_maxsymlinklen to struct ufsmount

2016-02-26 Thread Martin Natano
Sorry, the second message was not supposed to go to the list...

move mnt_maxsymlinklen to struct ufsmount

2016-02-26 Thread Martin Natano
The concept of differentiating between "short" and "long" symlinks is specific to ufs/, but the relevant variable is contained in struct mount, which is used by all filesystems. I think it would be a worthwile effort to clear this up by moving maxsymlinklen to struct ufsmount instead. Filesystem co

Re: diff -e: mishandling of bare dots

2016-02-27 Thread Martin Natano
Last chance to voice objections. I plan to commit this in the next days. natano > Index: diffreg.c > === > RCS file: /cvs/src/usr.bin/diff/diffreg.c,v > retrieving revision 1.90 > diff -u -p -r1.90 diffreg.c > --- diffreg.c 26 Oct 2

read(2) shouldn't return EFBIG

2016-02-28 Thread Martin Natano
The ext2fs_read() and ffs_read() functions return EFBIG when uio_offset if smaller than zero or larger than the maxium file size. However this doesn't seem to be in accordance with the POSIX read(2) specification, which requires EINVAL for an invalid offset (< 2) and a return of 0 (zero bytes trans

Re: tmpfs improvements

2016-02-28 Thread Martin Natano
On Sat, Feb 27, 2016 at 05:44:49PM -0500, Michael McConville wrote: > * There wasn't yet a list of possible errors for tmpfs in mount(2). >That said, I question the value of maintaining these lists. It's >almost impossible for them to be comprehensive - for example, some >*_mount() fun

Re: read(2) shouldn't return EFBIG

2016-02-28 Thread Martin Natano
On Sun, Feb 28, 2016 at 04:40:21PM +0100, Stefan Kempf wrote: > Stefan Kempf wrote: > > Martin Pieuchot wrote: > > > I'm also wondering when you say "an offset that's at or paste the > > > EOF" does that include ``uio_resid''? I mean shouldn't you check > > > for: > > > > > > if ((uio->uio_offs

Re: Switch to uiomove in usb

2016-02-29 Thread Martin Natano
On Sun, Feb 28, 2016 at 08:14:39PM +0100, Stefan Kempf wrote: > This changes uiomovei calls to uiomove in usb. It fixes > a few integer truncations due to use of min, and uses > unsigned types for count variables where it makes sense. > This also allows us to get rid of a couple of 'if (len < 0)' c

Re: monitor_fdpass.c: print ssize_t with %zd

2016-02-29 Thread Martin Natano
On Mon, Feb 29, 2016 at 07:56:22PM +0100, Jeremie Courreges-Anglas wrote: > > ok? Looks good to me. > > Index: libexec/ftpd/monitor_fdpass.c > === > RCS file: /cvs/src/libexec/ftpd/monitor_fdpass.c,v > retrieving revision 1.6 > dif

Re: kern_sched.c: unused functions

2016-03-02 Thread Martin Natano
On Wed, Mar 02, 2016 at 05:07:21PM +0100, Michal Mazurek wrote: > kern_sched.c: > - remove unused functions > - mark static functions as static Functions shouldn't be static in the kernel. "In userland, functions local to one source module should be declared ‘static’. This should not be done in k

remove VOP_UNLOCK() flags

2016-03-02 Thread Martin Natano
The VOP_UNLOCK() function has a flags parameter, which is documented to should be zero in most cases. It turns out that the flags argument is zero for all ~200 callers in the tree. On a closer look it is revealed that VOP_UNLOCK() uses lockmgr() for all filesystems that support locking. The only l

Re: cp -i might violate POSIX

2016-03-05 Thread Martin Natano
> Maybe it's just the alias being ignored by nice: nice executes the utility with execvp(), so it doesn't have a way to know about your alias, as the shell is not involved. The alias is also not expanded before calling nice, because it is not the first word in the line. natano

Re: proc.h: update PID_MAX after sys/compat is gone

2016-03-05 Thread Martin Natano
On Sat, Mar 05, 2016 at 11:32:04AM -0800, Philip Guenther wrote: > On Sat, Mar 5, 2016 at 8:10 AM, Michal Mazurek wrote: > > sys/compat is gone. I don't know if PID_MAX can or should be increased, > > but I don't think the comment is now useful. > > I think we can go a bit further now and include

Re: [PATCH] make 'set +o' useful and POSIX compatible

2016-03-06 Thread Martin Natano
On Sun, Mar 06, 2016 at 05:32:16AM +0100, Martijn Dekker wrote: > The command 'set -o' shows the current shell options in an unspecified > format. Less well-known is the variant 'set +o', which should output the > current shell options "in a format that is suitable for reinput to the > shell as com

Re: [PATCH] make 'set +o' useful and POSIX compatible

2016-03-06 Thread Martin Natano
> Index: bin/ksh/misc.c > === > RCS file: /cvs/src/bin/ksh/misc.c,v > retrieving revision 1.53 > diff -u -p -u -r1.53 misc.c > --- bin/ksh/misc.c21 Dec 2015 04:57:50 - 1.53 > +++ bin/ksh/misc.c6 Mar 2016 04:27:20 -

teach kdump(1) about more ioctls

2016-03-12 Thread Martin Natano
There are bunch of ioctl definitions kdump(1) doesn't know about yet, with the result, that kdump prints the numerical value of the ioctl and not the name of the definition. This patch adds support for ipmi, vscsi, pvbus, udl, fuse, trunk, pipex and memrange. OK? natano Index: Makefile ===

Re: COLUMNS handling

2016-03-14 Thread Martin Natano
On Mon, Mar 14, 2016 at 10:57:36AM +0100, Marc Espie wrote: > > So, does it make sense to put COLUMNS and SIZE forward ? > I think this is the first important question to ask... > > (I remember having COLUMNS and LINES hardcoded in my old, old .profile > around SunOS4... we can probably assume

Re: COLUMNS handling

2016-03-15 Thread Martin Natano
On Mon, Mar 14, 2016 at 02:02:47PM -0600, Abel Abraham Camarillo Ojeda wrote: > On Mon, Mar 14, 2016 at 5:32 AM, Martin Natano wrote: > > On Mon, Mar 14, 2016 at 10:57:36AM +0100, Marc Espie wrote: > >> > >> So, does it make sense to put COLUMNS and SIZE forward ? >

newfs_ext2fs image permissions

2016-03-15 Thread Martin Natano
I don't see how execute permissions on a file system image would be useful. Ok? Index: newfs_ext2fs.c === RCS file: /cvs/src/sbin/newfs_ext2fs/newfs_ext2fs.c,v retrieving revision 1.24 diff -u -p -r1.24 newfs_ext2fs.c --- newfs_ext2

increase v_specbitmap size (allow more cloned devices)

2016-03-30 Thread Martin Natano
I'm currently working on a diff to make bpf a cloning device. Therefore it is necessary to increase the number of clones possible of a cloning device, as there are users with a need for more than 64 open bpf devices at the same time. mikeb@ pointed me to this thread: https://marc.info/?l=openbsd-te

Re: increase v_specbitmap size (allow more cloned devices)

2016-03-31 Thread Martin Natano
Thank you all for the input. Allocatig the bitmap via malloc() really seems like the way to go, so we don't waste space for non-cloning devices. See updated patch below. Would it make sense to move the (rdev == VCHR && ...) condition to a macro in ? I figured it's only used twice, so I inlined it.

Re: increase v_specbitmap size (allow more cloned devices)

2016-03-31 Thread Martin Natano
On Thu, Mar 31, 2016 at 12:31:14PM +, Miod Vallat wrote: > > > Thank you all for the input. Allocatig the bitmap via malloc() really > > seems like the way to go, so we don't waste space for non-cloning > > devices. See updated patch below. > > > > Would it make sense to move the (rdev == VCHR

Re: increase v_specbitmap size (allow more cloned devices)

2016-03-31 Thread Martin Natano
On Thu, Mar 31, 2016 at 06:02:07AM -0600, Todd C. Miller wrote: > On Thu, 31 Mar 2016 09:34:32 +0200, Martin Natano wrote: > > > Thank you all for the input. Allocatig the bitmap via malloc() really > > seems like the way to go, so we don't waste space for non-cloning &

increase clone bitmap size (again)

2016-04-02 Thread Martin Natano
Below is the fixed v_specbitmap enlargements diff, including some tweaks by mikeb@. I have tested this with fuse _and_ drm on amd64 and macppc. I also tested on macppc with cloning bpf (not in the tree). Can anyone come up with another interesting test case? Comments? Ok? natano Index: sys/spec

Re: bug in grep

2016-04-03 Thread Martin Natano
On Sun, Apr 03, 2016 at 09:14:40AM +0200, Otto Moerbeek wrote: > On Sat, Apr 02, 2016 at 09:13:20PM +, H??ctor Luis Gimbatti wrote: > > > Hi, > > Apparently the error seems to be in /usr/src/usr.bin/grep/util.c at line > > 400: > > > > if ((!(lflag || cflag)) && ((!(bol || eol)) && >

Re: libc: prefer _MUTEX_LOCK() over _THREAD_PRIVATE_MUTEX_LOCK()

2016-04-04 Thread Martin Natano
On Sun, Apr 03, 2016 at 08:20:57PM -0700, Philip Guenther wrote: > > libc has a number of macros for dealing with thread safety such that it > can operate efficiently when single-threaded but Do The Right Thing when > multi-threaded. In include/thread_private.h are two sets of macros that > lo

Re: libc: prefer _MUTEX_LOCK() over _THREAD_PRIVATE_MUTEX_LOCK()

2016-04-05 Thread Martin Natano
On Mon, Apr 04, 2016 at 07:18:36PM -0700, Philip Guenther wrote: > On Mon, 4 Apr 2016, Martin Natano wrote: > > On Sun, Apr 03, 2016 at 08:20:57PM -0700, Philip Guenther wrote: > ... > > > So, diff below converts several uses of _THREAD_PRIVATE_MUTEX_*() to > > > _

cloning bpf

2016-04-05 Thread Martin Natano
The following patch enables device cloning for bpf, which allows to have just one bpf device node in /dev, that services all bpf consumers (up to 1024). Cloning bpf offers some advantages to the current situation: - Users with high bpf usage won't have to clutter /dev with device nodes. - A lot

Re: remove MPSAFE from makesyscalls.sh

2016-04-07 Thread Martin Natano
On Wed, Apr 06, 2016 at 03:42:20PM +0200, Michal Mazurek wrote: > MPSAFE is never used, and doesn't look like it's even supported (no > matching SY_MPSAFE anywhere). SY_MPSAFE seems to be unused since it's introduction in 2007 and it doesn't have any effect; ok natano@, if no one comes up with a r

Re: sys_process.c: remove relebad

2016-04-07 Thread Martin Natano
On Wed, Apr 06, 2016 at 09:47:35AM +0200, Michal Mazurek wrote: > relebad used to have more body: > relebad: > PRELE(t); > return (error); > But then PRELE(t); was removed. This diff gets rid of what remains of > relebad. Looks good to me. > > Index: sys/kern/s

Re: document NOLOCK in syscalls.master

2016-04-07 Thread Martin Natano
On Wed, Apr 06, 2016 at 02:45:46PM +0200, Michal Mazurek wrote: > * document NOLOCK - copy and paste from the commit message. That's useful. > * mention INDIR and NOLOCK in 'Fields'. How about something like "one of the types listed below, or one of the compatibility options defined in syscalls

request for testing: rbootd timeout fix

2016-04-14 Thread Martin Natano
In rbootd a struct bpf_timeval (with 32bit tv_sec) is copied to a struct timeval (with 64 tv_sec) via bcopy(). This most likely causes connections to not time out correctly in rbootd. I don't have an HP machine to test this with. Who owns such a machine and is willing to test this? natano Index:

Re: request for testing: rbootd timeout fix

2016-04-18 Thread Martin Natano
On Sat, Apr 16, 2016 at 11:10:14AM +0100, Stuart Henderson wrote: > On 2016/04/15 23:07, Philip Guenther wrote: > > On Thu, Apr 14, 2016 at 3:15 PM, Martin Natano wrote: > > > In rbootd a struct bpf_timeval (with 32bit tv_sec) is copied to a struct > > > timeval (with 6

Re: tr.1 -s wording

2016-04-19 Thread Martin Natano
On Mon, Apr 18, 2016 at 07:11:46PM -0400, Christian Heckendorf wrote: > Hi, > After reading the man page description of tr -s, I couldn't understand > what it meant to "squeeze" characters. It could be that 'squeeze' is a > mnemonic for '-s' but it's not helpful as a technical explanation. Your di

numerous statfs bugs

2016-04-19 Thread Martin Natano
There seem to be a number of issues with statfs related code in the kernel. The first issue is inside of the copy_statfs_info() function which is designed to be used by the filesystem's .vfs_statfs implementations to copy data from mp->mnt_stat to the target stat buffer. copy_statfs_info() always c

Re: numerous statfs bugs

2016-04-25 Thread Martin Natano
On Sun, Apr 24, 2016 at 01:48:04PM +0200, Stefan Kempf wrote: > > Diff reads good to me. Any reason why you changed setting f_mntfromname > from "fusefs" to "fuse"? No, it's a typo; updated diff below. Thanks! natano Index: isofs/cd9660/cd9660_vfsops.c

bpf device nodes

2016-04-27 Thread Martin Natano
Following diff replaces /dev/bpf[0-9] with only /dev/bpf and /dev/bpf0. The /dev/bpf node is unused for now, but I plan to convert all programs in base to use it in a future diff. /dev/bpf0 is for compatibility with existing binaries and is to be removed after a transition period. install.sub cont

tcpdump: use /dev/bpf

2016-05-01 Thread Martin Natano
This is the first diff in a series to move base to /dev/bpf. I think tcpdump is a good starting point, because it is easy to test. Ok? natano Index: privsep_pcap.c === RCS file: /cvs/src/usr.sbin/tcpdump/privsep_pcap.c,v retrieving

dhclient: use /dev/bpf

2016-05-02 Thread Martin Natano
Diff below simplifies the device open path and removes an explanation about bpf device nodes from the manpage. Ok? natano Index: bpf.c === RCS file: /cvs/src/sbin/dhclient/bpf.c,v retrieving revision 1.38 diff -u -p -r1.38 bpf.c --

libpcap: use /dev/bpf

2016-05-02 Thread Martin Natano
And again: /dev/bpf instead of /dev/bpf*. Ok? natano Index: pcap-bpf.c === RCS file: /cvs/src/lib/libpcap/pcap-bpf.c,v retrieving revision 1.32 diff -u -p -r1.32 pcap-bpf.c --- pcap-bpf.c 22 Dec 2015 19:51:04 - 1.32 +++ pc

Re: bpf device nodes

2016-05-04 Thread Martin Natano
On Tue, May 03, 2016 at 05:09:47AM -0600, Theo de Raadt wrote: > > On 2016-04-27, Martin Natano wrote: > > > > > /dev/bpf0 is for compatibility with existing binaries and is to > > > be removed after a transition period. > > > > What's the impac

Re: dhclient: use /dev/bpf

2016-05-06 Thread Martin Natano
On Thu, May 05, 2016 at 09:30:43PM +0100, Stuart Henderson wrote: > On 2016/05/02 09:34, Martin Natano wrote: > > Diff below simplifies the device open path and removes an explanation > > about bpf device nodes from the manpage. > > There's a problem with this. If someo

Re: dhclient: use /dev/bpf

2016-05-07 Thread Martin Natano
On Fri, May 06, 2016 at 07:17:50PM +0100, Stuart Henderson wrote: > > Personally, my preferred course of action would be to switch to > looking for /dev/bpf0 for now (bpf0 only: *not* revert to the old > loop, that's not necessary), and then switch to /dev/bpf > immediately after 6.0 is released.

kill LK_CANRECURSE

2016-05-12 Thread Martin Natano
Despite being redundant, the LK_CANRECURSE flag isn't checked anywhere. Ok? natano Index: sys/kern/kern_lock.c === RCS file: /cvs/src/sys/kern/kern_lock.c,v retrieving revision 1.46 diff -u -p -r1.46 kern_lock.c --- sys/kern/kern_l

Re: ping: Style fixes/cleanups

2017-06-13 Thread Martin Natano
On Tue, Jun 13, 2017 at 08:02:13PM +0200, Klemens Nanni wrote: > Unify option checking and simply logic. > > F_HDRINCL and F_ROUTE are mutually exclusive, thus check the latter only > if the former one is not set. > > Index: ping.c > ===

Re: CPU_LIDSUSPEND in init(8) and reboot(8)

2017-06-13 Thread Martin Natano
ping? On Sun, May 21, 2017 at 09:46:45AM +0200, Martin Natano wrote: > While switching init and reboot to CPU_LIDACTION, I forgot about the > #ifdef's. Ok? > > natano > > > Index: init/init.c > === &

Re: vi(1): remove stub settings

2017-07-02 Thread Martin Natano
On Fri, Jun 30, 2017 at 09:19:31AM -0600, Anthony J. Bentley wrote: > > Here's a diff that updates the STANDARDS section in the manual. > I think it will be enough to talk about our POSIX compliance. POSIX > discusses its differences from historical ex/vi in great detail, > including an explicit r

remove CPU_LIDSUSPEND/machdep.lidsuspend

2017-07-11 Thread Martin Natano
Go ahead replacing machdep.lidsuspend with cpu.lidaction. OpenBSD 6.1 contains both MIBs, so there is a clear path for migration. ok? natano Index: arch/amd64/amd64/machdep.c === RCS file: /cvs/src/sys/arch/amd64/amd64/machdep.c,v

Re: remove CPU_LIDSUSPEND/machdep.lidsuspend

2017-07-11 Thread Martin Natano
On Tue, Jul 11, 2017 at 02:40:16PM -0700, Mike Larkin wrote: > On Tue, Jul 11, 2017 at 11:19:17PM +0200, Martin Natano wrote: > > Go ahead replacing machdep.lidsuspend with cpu.lidaction. OpenBSD 6.1 > > cpu.lidaction or machdep.lidaction? machdep.lidaction; I got confused by the #define name.

sysctl machdep.lidaction=suspend

2017-07-29 Thread Martin Natano
Words are more descriptive than numbers. Let's use them! This diff removes sysctl machdep.lidaction=0 sysctl machdep.lidaction=1 sysctl machdep.lidaction=2 in favor of the more descriptive sysctl machdep.lidaction=none sysctl machdep.lidaction=suspend

Re: sysctl machdep.lidaction=suspend

2017-07-29 Thread Martin Natano
On Sat, Jul 29, 2017 at 02:03:22PM +0200, Mark Kettenis wrote: > > I don't think we want to add string parsing like this in the kernel. > Maybe the sysctl(8) frontend should do the mapping from strings to > numbers? Ok, I'll try to come up with an alternative diff that does the parsing in sysctl(

Re: sysctl machdep.lidaction=suspend

2017-07-29 Thread Martin Natano
On Sat, Jul 29, 2017 at 02:19:50PM +0200, Martin Natano wrote: > On Sat, Jul 29, 2017 at 02:03:22PM +0200, Mark Kettenis wrote: > > > > I don't think we want to add string parsing like this in the kernel. > > Maybe the sysctl(8) frontend should do the mapping from strin

Re: msg buf lmin

2016-05-19 Thread Martin Natano
On Thu, May 19, 2016 at 02:03:43AM +0200, Alexander Bluhm wrote: > Hi, > > All msg buf counters are long, so lmin(9) should be used here. > > ok? Looks good to me. > > bluhm > > Index: kern/subr_log.c > === > RCS file: /cvs/src/

remove cluster_write() remains

2016-05-21 Thread Martin Natano
VOP_ALLOCBLKS() and related code is unused since the removal of cluster_write(). This diff even shrinks /bsd by 8kb. Ok? natano Index: sbin/sysctl/sysctl.8 === RCS file: /cvs/src/sbin/sysctl/sysctl.8,v retrieving revision 1.194 diff

remove doforce from kern/vfs_subr.c

2016-05-26 Thread Martin Natano
The doforce variable isn't modified anywhere. Also, the only filesystem left using it is fuse. It has been removed from all other filesystems. Ok to remove? natano Index: kern/vfs_subr.c === RCS file: /cvs/src/sys/kern/vfs_subr.c,v

replace bpf open loops

2016-05-26 Thread Martin Natano
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 issue (/dev/bpf vs. /dev/bpf0) has been fixed. I didn't hear any other complaints in the meantime. Ok? Too soon? natano Index: usr

Re: use ${CC} -E rather than ${CPP}

2016-05-26 Thread Martin Natano
See one comment inline. On Thu, May 26, 2016 at 09:59:24AM -0600, Todd C. Miller wrote: > Since /usr/bin/cpp still specified -traditional, use ${CC} -E > instead. I've had this rotting in my tree for years now. > > - todd > > Index: lib/libcurses/Makefile >

Re: use ${CC} -E rather than ${CPP}

2016-05-26 Thread Martin Natano
On Thu, May 26, 2016 at 02:14:29PM -0600, Todd C. Miller wrote: > On Thu, 26 May 2016 22:07:14 +0200, Martin Natano wrote: > > > > diff -u -p -u -r1.11 Makefile > > > --- share/locale/ctype/Makefile 20 Mar 2016 15:45:40 - 1.11 > > > +++ share/locale/c

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

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 process using PT_IO in co

Re: prefer AF_* over PF_*

2016-05-29 Thread Martin Natano
On Sat, May 28, 2016 at 07:55:00PM -0700, Philip Guenther wrote: > > 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 > getaddri

Re: libc: delete unused hash algorithms

2016-05-29 Thread Martin Natano
On Sat, May 28, 2016 at 07:47:50PM -0700, Philip Guenther wrote: > > 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 >

lockmgr() api removal

2016-05-29 Thread Martin Natano
It is time for the lockmgr() api to die. The api is only used by filesystems, where it is a trivial change to use rrw locks instead. All it needs is LK_* defines for the RW_* flags. (See the sys/lock.h hunk in the diff below.) The ffs regress tests display the same number of fail/ok results before

Re: ancient relics in newsyslog

2016-06-01 Thread Martin Natano
On Wed, Jun 01, 2016 at 01:43:06AM -0400, Ted Unangst wrote: > Let's make the defaults be the defaults. Reads fine. ok natano@ > > Index: Makefile > === > RCS file: /cvs/src/usr.bin/newsyslog/Makefile,v > retrieving revision 1.6 >

  1   2   3   >