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: <alpine.DEB.2.20.1711231732560.1724@nanos>
Date:   Thu, 23 Nov 2017 17:34:03 +0100 (CET)
From:   Thomas Gleixner <tglx@...utronix.de>
To:     Chao Fan <fanc.fnst@...fujitsu.com>
cc:     hpa@...or.com, mingo@...hat.com, x86@...nel.org,
        keescook@...omium.org, gregkh@...uxfoundation.org,
        n-horiguchi@...jp.nec.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] kaslr: clean up a useless variable and some usless
 space

On Thu, 23 Nov 2017, Chao Fan wrote:

> There are two same variable "rc" in mem_avoid_memmap. One is in the
> circulation, the other is out of the circulation. The one out will never
> be used, so drop it.
> 
> Signed-off-by: Chao Fan <fanc.fnst@...fujitsu.com>
> ---
>  arch/x86/boot/compressed/kaslr.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c
> index a63fbc25ce84..8199a6187251 100644
> --- a/arch/x86/boot/compressed/kaslr.c
> +++ b/arch/x86/boot/compressed/kaslr.c
> @@ -171,7 +171,6 @@ parse_memmap(char *p, unsigned long long *start, unsigned long long *size)
>  static void mem_avoid_memmap(char *str)
>  {
>  	static int i;
> -	int rc;
>  
>  	if (i >= MAX_MEMMAP_REGIONS)
>  		return;
> @@ -219,7 +218,7 @@ static int handle_mem_memmap(void)
>  		return 0;
>  
>  	tmp_cmdline = malloc(len + 1);
> -	if (!tmp_cmdline )
> +	if (!tmp_cmdline)
>  		error("Failed to allocate space for tmp_cmdline");

This change is unrelated.

>  
>  	memcpy(tmp_cmdline, args, len);
> @@ -363,7 +362,7 @@ static void mem_avoid_init(unsigned long input, unsigned long input_size,
>  	cmd_line |= boot_params->hdr.cmd_line_ptr;
>  	/* Calculate size of cmd_line. */
>  	ptr = (char *)(unsigned long)cmd_line;
> -	for (cmd_line_size = 0; ptr[cmd_line_size++]; )
> +	for (cmd_line_size = 0; ptr[cmd_line_size++];)

Ditto.

>  		;
>  	mem_avoid[MEM_AVOID_CMDLINE].start = cmd_line;
>  	mem_avoid[MEM_AVOID_CMDLINE].size = cmd_line_size;

Thanks,

	tglx

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ