Messages in this thread Patch in this message | | | From | Rusty Russell <> | Subject | [PATCH 1/2] param: don't make the kernel_param's const | Date | Thu, 22 Oct 2009 01:58:04 +1030 |
| |
In the case of charp params written via sysfs, we modify the flags word. On platforms where ro data is protected, this causes a fault.
Better is to get rid of that flags modification, but that patch series is non-trivial.
Reported-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h --- a/include/linux/moduleparam.h +++ b/include/linux/moduleparam.h @@ -90,7 +90,7 @@ struct kparam_array BUILD_BUG_ON_ZERO((perm) < 0 || (perm) > 0777 || ((perm) & 2)) \ + BUILD_BUG_ON_ZERO(sizeof(""prefix) > MAX_PARAM_PREFIX_LEN); \ static const char __param_str_##name[] = prefix #name; \ - static struct kernel_param __moduleparam_const __param_##name \ + static struct kernel_param __param_##name \ __used \ __attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void *)))) \ = { __param_str_##name, perm, isbool ? KPARAM_ISBOOL : 0, \
| |