[lkml]   [2009]   [Feb]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] mm: Fix dirty_bytes/dirty_background_bytes sysctls on 64bit arches
On Sun, 1 Feb 2009, Peter Zijlstra wrote:

> On Sun, 2009-02-01 at 02:22 +0100, Sven Wegener wrote:
> > We need to pass an unsigned long as the minimum, because it gets casted
> > to an unsigned long in the sysctl handler. If we pass an int, we'll
> > access four more bytes on 64bit arches, resulting in a random minimum
> > value.
> If that's so, how can any of those other limit values still be good?

The problem here is that we use proc_doulongvec_minmax(), which expects an
unsigned long. Most other sysctls use the dointvec versions and are safe,
as long as they pass an int. If they pass a char or a short, they're
subject to the same problem.

The other sysctls in sysctl.c that use proc_doulongvec_minmax() don't pass
a min/max value. The others in the kernel I checked do the same or pass a
proper unsigned long.


 \ /
  Last update: 2009-02-01 11:25    [W:0.061 / U:3.404 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site