Messages in this thread | | | Date | Sun, 1 Feb 2009 11:22:40 +0100 (CET) | From | Sven Wegener <> | Subject | Re: [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.
Sven
| |