1
0
mirror of https://github.com/rancher/os-kernel.git synced 2025-06-24 04:37:04 +00:00
os-kernel/patches/elide-post-dash-cmdline-from-proc.patch
Sven Dowideit ef5eb127b4 Don't show kernel cmdline params after -- in /proc/cmdline
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2017-03-15 04:51:36 +00:00

19 lines
642 B
Diff

diff --git a/init/main.c b/init/main.c
index 2858be7..83fa41b 100644
--- a/init/main.c
+++ b/init/main.c
@@ -519,9 +519,12 @@ asmlinkage __visible void __init start_kernel(void)
static_command_line, __start___param,
__stop___param - __start___param,
-1, -1, NULL, &unknown_bootoption);
- if (!IS_ERR_OR_NULL(after_dashes))
+ if (!IS_ERR_OR_NULL(after_dashes)) {
+ /* elide the non-kernel params by puting a \0 just after the -- */
+ saved_command_line[after_dashes-static_command_line-1] = "\0";
parse_args("Setting init args", after_dashes, NULL, 0, -1, -1,
NULL, set_init_arg);
+ }
jump_label_init();