zImage-arm: init modified_cmdline with zero
Subsystems (2)
PATCH 1/1 zImage-arm: init modified_cmdline with zero
This patch memset modified_cmdline after it alloced.
Without this patch, the header of command line always contains random value like following example:
kernel: 0x765fd008 kernel_size: 0x23b610
memory range: [0x60000000 - 0x6fffffff] (256M) memory range: [0x78000000 - 0x9fffffff] (640M)
...
kernel command line: "°¥氥䐶# elfcorehdr=0x77f00000 mem=130048K"
--- kexec/arch/arm/kexec-zImage-arm.c | 2 ++ 1 file changed, 2 insertions(+)
kexec/arch/arm/kexec-zImage-arm.c +2 -0
@@ -378,6 +378,8 @@ int zImage_arm_load(int argc, char **argv, const char *buf, off_t len,if (!modified_cmdline)return -1 ; +memset (modified_cmdline,'\0' ,COMMAND_LINE_SIZE ); +if (command_line) { (void )strncpy (modified_cmdline, command_line,COMMAND_LINE_SIZE );
Signature · 7 lines
1.8.4 _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
Simon Horman
AppliedQuoted 5 lines · Wang Nan
This patch memset
modified_cmdlineafter it alloced.Without this patch, the header of command line always contains random value like following example:
Quoted 8 lines
kernel:
0x765fd008kernel_size:0x23b610
memory range: [0x60000000-0x6fffffff] (256M) memory range: [0x78000000-0x9fffffff] (640M)
...
kernel command line: "°¥氥䐶# elfcorehdr=0x77f00000 mem=130048K"Signed-off-by Wang Nan <[email protected]>Cc Geng Hui <[email protected]>
Thanks, applied.
Quoted 21 lines
--- kexec/arch/arm/kexec-zImage-arm.c | 2 ++ 1 file changed, 2 insertions(+)kexec/arch/arm/kexec-zImage-arm.c +2
-0@@ -378,6 +378,8 @@ int zImage_arm_load(int argc, char **argv, const char *buf, off_t len,if (!modified_cmdline)return -1 ; +memset (modified_cmdline,'\0' ,COMMAND_LINE_SIZE ); +if (command_line) { (void )strncpy (modified_cmdline, command_line,COMMAND_LINE_SIZE );Signature · 1 line
1.8.4
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec