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:   Wed, 4 Jan 2023 12:24:34 +0200
From:   Mike Rapoport <rppt@...nel.org>
To:     Levi Yun <ppbuk5246@...il.com>
Cc:     akpm@...ux-foundation.org, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] [PATCH] memblock: Fix return sizeless candidate on
 __memblock_find_range_top_down.

On Wed, Jan 04, 2023 at 06:50:49PM +0900, Levi Yun wrote:
> __memblock_find_range_top_down can return start address of free region
> which sizeless then user speicified.
> To prevent the above case, add size check on candidate free region.

Did you see an actual issue or it's solely based on code inspection?
 
> Signed-off-by: Levi Yun <ppbuk5246@...il.com>
> ---
>  mm/memblock.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/memblock.c b/mm/memblock.c
> index 511d4783dcf1..710e2ef8d67d 100644
> --- a/mm/memblock.c
> +++ b/mm/memblock.c
> @@ -262,7 +262,7 @@ __memblock_find_range_top_down(phys_addr_t start, phys_addr_t end,
>  			continue;
>  
>  		cand = round_down(this_end - size, align);
> -		if (cand >= this_start)
> +		if (cand >= this_start && this_end - cand >= size)
>  			return cand;
>  	}
>  
> -- 
> 2.35.1
> 

-- 
Sincerely yours,
Mike.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ