2006-08-07 15:15:37

by Andy Whitcroft

[permalink] [raw]
Subject: [PATCH] x86_64 dirty fix to restore dual command line store

x86_64 dirty fix to restore dual command line store

Ok, It seems that the patch below effectivly removes the second
copy of the command line. This means that any modification to the
'working' command line (as returned from setup_arch) is incorrectly
visible in userspace via /proc/cmdline.

x86_64-mm-early-param.patch

This patch restores the second copy. Its probabally not the right
way to fix this long term.

Signed-off-by: Andy Whitcroft <[email protected]>
---
diff -upN reference/arch/x86_64/kernel/setup.c current/arch/x86_64/kernel/setup.c
--- reference/arch/x86_64/kernel/setup.c
+++ current/arch/x86_64/kernel/setup.c
@@ -378,7 +378,8 @@ void __init setup_arch(char **cmdline_p)
early_identify_cpu(&boot_cpu_data);

parse_early_param();
- *cmdline_p = saved_command_line;
+ memcpy(command_line, saved_command_line, COMMAND_LINE_SIZE);
+ *cmdline_p = command_line;

finish_e820_parsing();


2006-08-07 21:47:09

by Keith Mannthey

[permalink] [raw]
Subject: Re: [PATCH] x86_64 dirty fix to restore dual command line store

On 8/7/06, Andy Whitcroft <[email protected]> wrote:
> x86_64 dirty fix to restore dual command line store
>
> Ok, It seems that the patch below effectivly removes the second
> copy of the command line. This means that any modification to the
> 'working' command line (as returned from setup_arch) is incorrectly
> visible in userspace via /proc/cmdline.

Sorry for the side question but why is setup_arch adding things back
on the cmdline in the first place? What do you see in /proc/cmdline?

Thanks,
Keith

2006-08-07 21:59:53

by Keith Mannthey

[permalink] [raw]
Subject: Re: [PATCH] x86_64 dirty fix to restore dual command line store

On 8/7/06, Keith Mannthey <[email protected]> wrote:
> On 8/7/06, Andy Whitcroft <[email protected]> wrote:
> > x86_64 dirty fix to restore dual command line store
> >
> > Ok, It seems that the patch below effectivly removes the second
> > copy of the command line. This means that any modification to the
> > 'working' command line (as returned from setup_arch) is incorrectly
> > visible in userspace via /proc/cmdline.
>
> Sorry for the side question but why is setup_arch adding things back
> on the cmdline in the first place? What do you see in /proc/cmdline?

Sorry for the ping. I read some more lkml and the context for this
patch was filled in.

Thanks,
Keith