Reject unaligned I/O in physio()

2011-07-05 Thread Matthew Dempsky
Currently physio() sets bp-b_blkno = btodb(uio-uio_offset), which can silently truncate the offset if the read or write starts misaligned (e.g., due to lseek(2) or using pread(2)/pwrite(2)). This means that pread(fd, buf, 512, 0) and pread(fd, buf, 512, 42) return the same sector. Diff below

Re: msync retardery

2011-07-05 Thread Philip Guenther
On Mon, Jul 4, 2011 at 12:50 PM, Owain Ainsworth zer...@googlemail.com wrote: So, the msync implementation in uvm says this: /* * XXXCDC: do we really need this semantic? * * XXX Gak! If size is zero we are supposed to sync all modified * pages with the

Para los mas chicos

2011-07-05 Thread Vacaciones
EL MARAVILLOSO MUNDO DE PIPO UNA COLECCION IDEAL PARA ESTIMULAR EL APRENDIZAJE DE LOS MAS CHICOS EL MARAVILLOSO MUNDO DE PIPO es una coleccisn de juegos educativos , con la que los niqos se divierten y aprenden jugando. Cada tmtulo esta enfocado para que los mas pequeqos de la casa (De 3 a 12

Re: kdump: struct stat and struct sockaddr

2011-07-05 Thread Ted Unangst
On Tue, Jul 05, 2011, Otto Moerbeek wrote: Hi, this adds decoding of some interesting structs to kdump. Mostly from FreeBSD, but adapted to our tree. very cool, just a one comment below. error = copyout(mtod(m, caddr_t), SCARG(uap, asa), len); - if (error == 0) + if (error == 0)

Re: kdump: struct stat and struct sockaddr

2011-07-05 Thread Otto Moerbeek
On Tue, Jul 05, 2011 at 12:08:26PM -0400, Ted Unangst wrote: On Tue, Jul 05, 2011, Otto Moerbeek wrote: Hi, this adds decoding of some interesting structs to kdump. Mostly from FreeBSD, but adapted to our tree. very cool, just a one comment below. error = copyout(mtod(m,

fix a pool bug

2011-07-05 Thread Ted Unangst
Remove a broken optimization found by the new pool_chk code. It leaves an empty page in curpage, and this inconsistency slowly spreads until finally one of the other pool checks freaks out. This is only likely to occur if you are running into PR_WANTED frequently. In my case, I was constantly

Re: kdump: struct stat and struct sockaddr

2011-07-05 Thread Otto Moerbeek
On Tue, Jul 05, 2011 at 06:17:53PM +0200, Otto Moerbeek wrote: On Tue, Jul 05, 2011 at 12:08:26PM -0400, Ted Unangst wrote: On Tue, Jul 05, 2011, Otto Moerbeek wrote: Hi, this adds decoding of some interesting structs to kdump. Mostly from FreeBSD, but adapted to our tree.

Re: wcsdup

2011-07-05 Thread Todd C. Miller
The code looks fine to me, though you don't need to include stdint.h. It is basically identical to what is in FreeBSD too. In the man page example: if (p = wcsdup(Lfoobar), p == NULL) { I think it is best to either write this as: if ((p = wcsdup(Lfoobar)) == NULL) { or just split it

Re: wcsdup

2011-07-05 Thread Joerg Sonnenberger
On Tue, Jul 05, 2011 at 01:52:06PM -0400, Todd C. Miller wrote: if ((p = wcsdup(Lfoobar)) == NULL) { or just split it into two lines. Using the comma operator that way is correct but likely to confuse some readers. Also, what is that 'L' doing there before the foobar? Is it some sort

Re: wcsdup

2011-07-05 Thread Stefan Sperling
On Tue, Jul 05, 2011 at 01:52:06PM -0400, Todd C. Miller wrote: Also, what is that 'L' doing there before the foobar? Is it some sort of wide char thing I'm not aware of? L is C99 notation for wide character string literals. wchar_t is an int, so a pointer increment will consume 4 bytes, not

memcpy len in iked

2011-07-05 Thread Ted Unangst
found by jsg. Index: config.c === RCS file: /home/tedu/cvs/src/sbin/iked/config.c,v retrieving revision 1.12 diff -u -p -r1.12 config.c --- config.c9 May 2011 11:15:18 - 1.12 +++ config.c5 Jul 2011 18:23:17 - @@

Re: memsets in bind

2011-07-05 Thread Miod Vallat
found by jsg. Index: lib/isc/hmacsha.c === RCS file: /home/tedu/cvs/src/usr.sbin/bind/lib/isc/hmacsha.c,v retrieving revision 1.1.1.1 diff -u -p -r1.1.1.1 hmacsha.c --- lib/isc/hmacsha.c 9 Dec 2007 12:34:04 -

Re: wcsdup

2011-07-05 Thread Nicholas Marriott
Hi I committed a version without the range check so I removed stdint.h as well. Although I can't believe I didn't notice that p == NULL stuff in the man page. Ugh. I'll fix it like you say and also have a look at a replacement for the L stuff as Stefan mentioned in a bit. Thanks On Tue, Jul

Re: memsets in bind

2011-07-05 Thread Kenneth R Westerback
On Tue, Jul 05, 2011 at 06:54:49PM +, Miod Vallat wrote: found by jsg. Index: lib/isc/hmacsha.c === RCS file: /home/tedu/cvs/src/usr.sbin/bind/lib/isc/hmacsha.c,v retrieving revision 1.1.1.1 diff -u -p -r1.1.1.1

Re: memsets in bind

2011-07-05 Thread Ted Unangst
On Tue, Jul 05, 2011, Miod Vallat wrote: found by jsg. Index: lib/isc/hmacsha.c === RCS file: /home/tedu/cvs/src/usr.sbin/bind/lib/isc/hmacsha.c,v retrieving revision 1.1.1.1 diff -u -p -r1.1.1.1 hmacsha.c ---

Re: memsets in bind

2011-07-05 Thread Christiano F. Haesbaert
On 5 July 2011 15:47, Ted Unangst t...@tedunangst.com wrote: found by jsg. Index: lib/isc/hmacsha.c === RCS file: /home/tedu/cvs/src/usr.sbin/bind/lib/isc/hmacsha.c,v retrieving revision 1.1.1.1 diff -u -p -r1.1.1.1 hmacsha.c

Re: memsets in bind

2011-07-05 Thread Christiano F. Haesbaert
On 5 July 2011 16:50, Christiano F. Haesbaert haesba...@haesbaert.org wrote: On 5 July 2011 15:47, Ted Unangst t...@tedunangst.com wrote: found by jsg. Index: lib/isc/hmacsha.c === RCS file:

Re: memsets in bind

2011-07-05 Thread Theo de Raadt
found by jsg. Index: lib/isc/hmacsha.c === RCS file: /home/tedu/cvs/src/usr.sbin/bind/lib/isc/hmacsha.c,v retrieving revision 1.1.1.1 diff -u -p -r1.1.1.1 hmacsha.c --- lib/isc/hmacsha.c 9 Dec 2007 12:34:04

Re: checksum revamp

2011-07-05 Thread Henning Brauer
I haven't received any feedback on this from anybody not in edmonton right now. please help us by testing this as much as you can, or you might end up finding out it broke in your usage case after the next release when you upgrade your production boxes... we wanna avoid that, mkay? * Henning

another pool tweak

2011-07-05 Thread Ted Unangst
move the internal accounting for a page being removed closer to removing it and before freeing it instead of after. also, rmpage updates curpage, so we don't need to do that twice. Index: subr_pool.c === RCS file:

Kill P_BIGLOCK

2011-07-05 Thread Artur Grabowski
P_BIGLOCK is only used to figure out if the process holds the biglock. The problem with this is that the first entry point from a sleepable context to the kernel needs to call KERNEL_PROC_LOCK while recursive (or non-process) entry points need to call KERNEL_LOCK. Pedro showed at least one entry

kernel make clean should delete .d

2011-07-05 Thread Ted Unangst
when I run make clean followed by ls, I want to see a fresh canvas, not the scattered leftovers of old builds. Index: Makefile.i386 === RCS file: /home/tedu/cvs/src/sys/arch/i386/conf/Makefile.i386,v retrieving revision 1.80 diff -u

remove predict in pool

2011-07-05 Thread Ted Unangst
We've been less than consistent maintaining usage of __predict in this file. Index: subr_pool.c === RCS file: /home/tedu/cvs/src/sys/kern/subr_pool.c,v retrieving revision 1.107 diff -u -p -r1.107 subr_pool.c --- subr_pool.c 6 Jul

Do you use set reassemble off?

2011-07-05 Thread Ryan McBride
If there is anyone out there who disables fragment reassembly (enabled by default), you need to help testing this diff which folds pf_test_fragment() into pf_test_rule(). If I don't hear from anyone we may one day decide that nobody actually does this and remove the ability to disable reassembly