Re: howmany macro: integer overflow

2014-06-17 Thread Tobias Stoeckmann
On Wed, Jun 18, 2014 at 08:20:16AM +0200, Alexander Hall wrote: > >RCS file: /cvs/src/sys/sys/param.h,v > > Where else could howmany come from? Can you be sure it's safe to use here? There are other places where howmany is defined, I can prepare a diff that will cover all definitions. For now, I

Re: howmany macro: integer overflow

2014-06-17 Thread Alexander Hall
On June 14, 2014 1:13:56 PM CEST, Tobias Stoeckmann wrote: >Hi, > >the howmany macro as used in param.h and select.h is prone to an >integer >overflow. It adds divisor-1 to the base value, which means that it >COULD overflow. > >Most of the times, the howmany macro is used with file descriptor

Re: sys/msdosfs: off by one

2014-06-17 Thread Bob Beck
On 17 Jun 2014 18:22, "Kenneth Westerback" wrote: > > On 17 June 2014 17:43, Tobias Stoeckmann wrote: > > On Mon, Jun 16, 2014 at 04:43:02PM -0700, John-Mark Gurney wrote: > >> FreeBSD fixed this by increasing the malloc size: > >> https://svnweb.freebsd.org/changeset/base/r126086 > > > > Which i

Re: fsck_msdos: out of boundary on file truncation

2014-06-17 Thread Kenneth Westerback
On 17 June 2014 18:09, Tobias Stoeckmann wrote: > Hi, > > fsck_msdos checks for linked cluster chains, which means that two chains > cross each other at the same cluster. If 1 links to 3 and 2 links to 3, > the cluster chains starting at 1 and 2 are linked. > > This error condition can be fixed du

Re: sys/msdosfs: off by one

2014-06-17 Thread Kenneth Westerback
On 17 June 2014 17:43, Tobias Stoeckmann wrote: > On Mon, Jun 16, 2014 at 04:43:02PM -0700, John-Mark Gurney wrote: >> FreeBSD fixed this by increasing the malloc size: >> https://svnweb.freebsd.org/changeset/base/r126086 > > Which is actually the correct way to do here! > > pmp->pm_maxcluster is

Turbo on i7

2014-06-17 Thread Gustav Fransson Nyvell
Hi, I want to alert you to this strange observation. $ sysctl -a ... hw.cpuspeed=3101 hw.setperf=100 ... This on an Intel i7 3920XM. Rated for 3.8GHz when running 100%. 3101 would mean 3.1GHz and hw.setperf=100 means it should/must run at 100%. //Gustav

fsck_msdos: out of boundary on file truncation

2014-06-17 Thread Tobias Stoeckmann
Hi, fsck_msdos checks for linked cluster chains, which means that two chains cross each other at the same cluster. If 1 links to 3 and 2 links to 3, the cluster chains starting at 1 and 2 are linked. This error condition can be fixed during phase 2, either one or both chains are dropped or the fi

Re: sys/msdosfs: off by one

2014-06-17 Thread Tobias Stoeckmann
On Mon, Jun 16, 2014 at 04:43:02PM -0700, John-Mark Gurney wrote: > FreeBSD fixed this by increasing the malloc size: > https://svnweb.freebsd.org/changeset/base/r126086 Which is actually the correct way to do here! pmp->pm_maxcluster is the largest valid _index_ of pmp->pm_inusemap, therefore we

Re: increase netcat's buffer...

2014-06-17 Thread Theo de Raadt
It should not use kevent. That makes the code non-portable. Use poll().

Patch: correct sysctl parameter in /sbin/route

2014-06-17 Thread Gregor Best
Hi people, according to sysctl(3), AF_ROUTE is incorrect as a second level name for the CTL_NET sysctl. The attached patch corrects this. Since PF_ROUTE is defined to AF_ROUTE, there are no functional changes, but the style stays consistent this way. I have also noticed that sysctl(3) does not do

Re: increase netcat's buffer...

2014-06-17 Thread sven falempin
On Mon, Jun 16, 2014 at 10:57 PM, Ted Unangst wrote: > On Sat, Jun 14, 2014 at 10:55, Ted Unangst wrote: > > On Fri, Jun 13, 2014 at 10:40, sven falempin wrote: > > Now soliciting diffs to change readwrite to a loop with two buffers > that poll()s in all four directions. :) >

Re: increase netcat's buffer...

2014-06-17 Thread sven falempin
On Mon, Jun 16, 2014 at 10:57 PM, Ted Unangst wrote: > On Sat, Jun 14, 2014 at 10:55, Ted Unangst wrote: > > On Fri, Jun 13, 2014 at 10:40, sven falempin wrote: > > Now soliciting diffs to change readwrite to a loop with two buffers > that poll()s in all four directions. :) >

Re: diff: add tuning variables to config(8)

2014-06-17 Thread YASUOKA Masahiko
Hi, On Tue, 17 Jun 2014 09:43:07 +0200 Claudio Jeker wrote: > On Mon, Jun 16, 2014 at 11:35:07AM -0600, Theo de Raadt wrote: >> > > Followings are our kernel variables' default: >> > > >> > > - sb_max: 256K >> > > - tcbhash_size: 128 >> > > - udbhash_size: 128 >> > > >> > > These variable

Re: diff: add tuning variables to config(8)

2014-06-17 Thread Claudio Jeker
On Mon, Jun 16, 2014 at 11:35:07AM -0600, Theo de Raadt wrote: > > > Followings are our kernel variables' default: > > > > > > - sb_max: 256K > > > - tcbhash_size: 128 > > > - udbhash_size: 128 > > > > > > These variables are sometime too small for busy server or gateway. > > > > > > I'd l