lkml.org 
[lkml]   [2007]   [Mar]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch] [bugfix] loop.c
On Fri, 23 Mar 2007, Michael Tokarev wrote:

> Speaking of which, I wonder... Here, and in many other places.
> If some variable is marked as MODULE_PARAM (or whatever it is called
> nowadays), used in module init routine, AND subsequently used for
> various bound checks and loops...
[...]
> and so on. Together with:
> # modprobe foo n=10
> # echo 20 > /sys/module/foo/parameters/n
> After that, we have 10 entries in mem[], and n is equal to 20, so the
> for-loop above will be up to i=19. Which will reference unallocated
> memory.... Amd I dreaming?

This can be solved either by using module_param_call() in every module,
and properly handling the "asynchronous" changes of module parameter, or
by just disallowing the parameter from being tuned through sysfs
completely (by setting the 'permissions' parameter of module_param() to
zero ... which is what many drivers do anyway, I'd guess).

--
Jiri Kosina
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-03-24 00:21    [W:0.088 / U:0.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site