lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 11 Sep 2007 15:14:45 +0200
From:	Olaf Dabrunz <od@...e.de>
To:	Bernhard Walle <bwalle@...e.de>
Cc:	kexec@...ts.infradead.org, linux-kernel@...r.kernel.org,
	linux-arch@...r.kernel.org
Subject: Re: [patch 1/5] Extended crashkernel command line

On 09-Sep-07, Bernhard Walle wrote:
> If there are multiple occurrences, then the last one is taken.  The advantage
> is that if you have a bootloader like lilo or elilo which allows you to append
> a command line parameter but not to remove one (like in GRUB), then you can add
> another crashkernel value for testing at the boot command line and this one
> overwrites the command line in the configuration then.

AFAIK it is the other way round: the lilo configuration-parameter
"append" appends the kernel parameters in the configuration to the
parameters given by the user on the kernel command line.

So the parameters set by the user during boot appear first on the
command line.

> Signed-off-by: Bernhard Walle <bwalle@...e.de>
> 
> ---
>  include/linux/kexec.h |    2 
>  kernel/kexec.c        |  139 ++++++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 141 insertions(+)
> 
> --- a/include/linux/kexec.h
> +++ b/include/linux/kexec.h
> @@ -179,6 +179,8 @@ extern note_buf_t *crash_notes;
>  extern u32 vmcoreinfo_note[VMCOREINFO_NOTE_SIZE/4];
>  extern unsigned int vmcoreinfo_size;
>  extern unsigned int vmcoreinfo_max_size;
> +int parse_crashkernel(char *cmdline, unsigned long long system_ram,
> +		unsigned long long *crash_size, unsigned long long *crash_base);
>  
>  [...]
>  
> +int parse_crashkernel(char 		 *cmdline,
> +		      unsigned long long system_ram,
> +		      unsigned long long *crash_size,
> +		      unsigned long long *crash_base)
> +{
> +	char 	*p = cmdline, *ck_cmdline = NULL;
> +	char	*first_colon, *first_space;
> +
> +	/* find crashkernel and use the last one if there are more */
> +	p = strstr(p, "crashkernel=");
> +	while (p) {
> +		ck_cmdline = p;
> +		p = strstr(p+1, "crashkernel=");
> +	}
> +

So perhaps something like this instead:

+	/* find crashkernel and use the first one if there are more */
+	p = strstr(p, "crashkernel=");
+	ck_cmdline = p;

> +	if (!ck_cmdline)
> +		return -EINVAL;
> +
> +	ck_cmdline += 12; /* strlen("crashkernel=") */
> +
> +	/*
> +	 * if the commandline contains a ':', then that's the extended
> +	 * syntax -- if not, it must be the classic syntax
> +	 */
> +	first_colon = strchr(ck_cmdline, ':');
> +	first_space = strchr(ck_cmdline, ' ');
> +	if (first_colon && (!first_space || first_colon < first_space))
> 
> [...]

-- 
Olaf Dabrunz (od/odabrunz), SUSE Linux Products GmbH, Nürnberg

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ