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]
Message-ID: <4A7A3847.6070406@redhat.com>
Date:	Thu, 06 Aug 2009 09:56:23 +0800
From:	Amerigo Wang <amwang@...hat.com>
To:	"Yu, Fenghua" <fenghua.yu@...el.com>
CC:	"'linux-kernel@...r.kernel.org'" <linux-kernel@...r.kernel.org>,
	"Luck, Tony" <tony.luck@...el.com>,
	"'linux-ia64@...r.kernel.org'" <linux-ia64@...r.kernel.org>,
	"'Neil Horman'" <nhorman@...hat.com>,
	"'Eric W. Biederman'" <ebiederm@...ssion.com>,
	"'akpm@...ux-foundation.org'" <akpm@...ux-foundation.org>,
	"'Ingo Molnar'" <mingo@...e.hu>,
	"'Anton Vorontsov'" <avorontsov@...mvista.com>
Subject: Re: [Patch 2/7] x86: implement crashkernel=auto

Yu, Fenghua wrote:
>> +#ifdef CONFIG_KEXEC_AUTO_RESERVE
>> +	if (strncmp(ck_cmdline, "auto", 4) == 0) {
>> +		unsigned long long size;
>> +		char tmp[32];
>> +
>> +		size = arch_default_crash_size(system_ram);
>> +		if (size != 0) {
>> +			*crash_size = size;
>> +			*crash_base = arch_default_crash_base();
>> +			size = scnprintf(tmp, sizeof(tmp), "%luM@...M",
>> +					(unsigned long)(*crash_size)>>20,
>> +					(unsigned long)(*crash_base)>>20);
>> +			/* size can't be <= 4. */
>> +			if (likely((size - 4 + strlen(cmdline))
>> +					< COMMAND_LINE_SIZE - 1)) {
>> +				memmove(ck_cmdline + size, ck_cmdline + 4,
>> +					strlen(cmdline) - (ck_cmdline + 4 - cmdline)
>> + 1);
>> +				memcpy(ck_cmdline, tmp, size);
>> +			}
>>     
>
> Here the variable "size" has two different meanings. First it used for crash size. Then its meaning is changed to buffer size in ck_cmdline. And types are different too. The type for crash size is unsigned long long. But scnprintf() return int.
>
> Could you use two variables to represent the two meanings for less confusion?
>   

Sure, OK, will do.

Thanks.

--
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