diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-11 19:09:14 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-11 19:09:14 -0400 |
| commit | 4251c2a67011801caecd63671f26dd8c9aedb24c (patch) | |
| tree | 06f659cb3f9e91fb2b8fc92791b5e021754e025e /init | |
| parent | c31c24b8251fd44962a9b0bf82c770653bf07f6e (diff) | |
| parent | 4982223e51e8ea9d09bb33c8323b5ec1877b2b51 (diff) | |
Merge tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux
Pull module updates from Rusty Russell:
"Most of this is cleaning up various driver sysfs permissions so we can
re-add the perm check (we unified the module param and sysfs checks,
but the module ones were stronger so we weakened them temporarily).
Param parsing gets documented, and also "--" now forces args to be
handed to init (and ignored by the kernel).
Module NX/RO protections get tightened: we now set them before calling
parse_args()"
* tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
module: set nx before marking module MODULE_STATE_COMING.
samples/kobject/: avoid world-writable sysfs files.
drivers/hid/hid-picolcd_fb: avoid world-writable sysfs files.
drivers/staging/speakup/: avoid world-writable sysfs files.
drivers/regulator/virtual: avoid world-writable sysfs files.
drivers/scsi/pm8001/pm8001_ctl.c: avoid world-writable sysfs files.
drivers/hid/hid-lg4ff.c: avoid world-writable sysfs files.
drivers/video/fbdev/sm501fb.c: avoid world-writable sysfs files.
drivers/mtd/devices/docg3.c: avoid world-writable sysfs files.
speakup: fix incorrect perms on speakup_acntsa.c
cpumask.h: silence warning with -Wsign-compare
Documentation: Update kernel-parameters.tx
param: hand arguments after -- straight to init
modpost: Fix resource leak in read_dump()
Diffstat (limited to 'init')
| -rw-r--r-- | init/main.c | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/init/main.c b/init/main.c index 0ec25157deef..e8ae1fef0908 100644 --- a/init/main.c +++ b/init/main.c | |||
| @@ -253,6 +253,27 @@ static int __init repair_env_string(char *param, char *val, const char *unused) | |||
| 253 | return 0; | 253 | return 0; |
| 254 | } | 254 | } |
| 255 | 255 | ||
| 256 | /* Anything after -- gets handed straight to init. */ | ||
| 257 | static int __init set_init_arg(char *param, char *val, const char *unused) | ||
| 258 | { | ||
| 259 | unsigned int i; | ||
| 260 | |||
| 261 | if (panic_later) | ||
| 262 | return 0; | ||
| 263 | |||
| 264 | repair_env_string(param, val, unused); | ||
| 265 | |||
| 266 | for (i = 0; argv_init[i]; i++) { | ||
| 267 | if (i == MAX_INIT_ARGS) { | ||
| 268 | panic_later = "init"; | ||
| 269 | panic_param = param; | ||
| 270 | return 0; | ||
| 271 | } | ||
| 272 | } | ||
| 273 | argv_init[i] = param; | ||
| 274 | return 0; | ||
| 275 | } | ||
| 276 | |||
| 256 | /* | 277 | /* |
| 257 | * Unknown boot options get handed to init, unless they look like | 278 | * Unknown boot options get handed to init, unless they look like |
| 258 | * unused parameters (modprobe will find them in /proc/cmdline). | 279 | * unused parameters (modprobe will find them in /proc/cmdline). |
| @@ -479,7 +500,7 @@ static void __init mm_init(void) | |||
| 479 | 500 | ||
| 480 | asmlinkage __visible void __init start_kernel(void) | 501 | asmlinkage __visible void __init start_kernel(void) |
| 481 | { | 502 | { |
| 482 | char * command_line; | 503 | char * command_line, *after_dashes; |
| 483 | extern const struct kernel_param __start___param[], __stop___param[]; | 504 | extern const struct kernel_param __start___param[], __stop___param[]; |
| 484 | 505 | ||
| 485 | /* | 506 | /* |
| @@ -519,9 +540,13 @@ asmlinkage __visible void __init start_kernel(void) | |||
| 519 | 540 | ||
| 520 | pr_notice("Kernel command line: %s\n", boot_command_line); | 541 | pr_notice("Kernel command line: %s\n", boot_command_line); |
| 521 | parse_early_param(); | 542 | parse_early_param(); |
| 522 | parse_args("Booting kernel", static_command_line, __start___param, | 543 | after_dashes = parse_args("Booting kernel", |
| 523 | __stop___param - __start___param, | 544 | static_command_line, __start___param, |
| 524 | -1, -1, &unknown_bootoption); | 545 | __stop___param - __start___param, |
| 546 | -1, -1, &unknown_bootoption); | ||
| 547 | if (after_dashes) | ||
| 548 | parse_args("Setting init args", after_dashes, NULL, 0, -1, -1, | ||
| 549 | set_init_arg); | ||
| 525 | 550 | ||
| 526 | jump_label_init(); | 551 | jump_label_init(); |
| 527 | 552 | ||
