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: <801b3438-92e6-4b34-8238-cce67f1899f1@redhat.com>
Date: Sat, 13 Jul 2024 03:20:56 +0200
From: David Hildenbrand <david@...hat.com>
To: Yang Shi <yang@...amperecomputing.com>, corsac@...ian.org,
 willy@...radead.org, jirislaby@...nel.org, surenb@...gle.com,
 riel@...riel.com, cl@...ux.com, carnil@...ian.org, ben@...adent.org.uk,
 akpm@...ux-foundation.org
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [PATCH] mm: huge_memory: use !CONFIG_64BIT to relax huge page
 alignment on 32 bit machines

On 12.07.24 17:58, Yang Shi wrote:
> Yves-Alexis Perez reported commit 4ef9ad19e176 ("mm: huge_memory: don't
> force huge page alignment on 32 bit") didn't work for x86_32 [1].  It is
> because x86_32 uses CONFIG_X86_32 instead of CONFIG_32BIT.
> 
> !CONFIG_64BIT should cover all 32 bit machines.
> 
> [1] https://lore.kernel.org/linux-mm/CAHbLzkr1LwH3pcTgM+aGQ31ip2bKqiqEQ8=FQB+t2c3dhNKNHA@mail.gmail.com/
> 
> Fixes: 4ef9ad19e176 ("mm: huge_memory: don't force huge page alignment on 32 bit")
> Reported-by: Yves-Alexis Perez <corsac@...ian.org>
> Tested-By: Yves-Alexis Perez <corsac@...ian.org>
> Cc: <stable@...r.kernel.org>    [6.8+]
> Signed-off-by: Yang Shi <yang@...amperecomputing.com>
> ---
>   mm/huge_memory.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/huge_memory.c b/mm/huge_memory.c
> index 2120f7478e55..64f00aedf9af 100644
> --- a/mm/huge_memory.c
> +++ b/mm/huge_memory.c
> @@ -857,7 +857,7 @@ static unsigned long __thp_get_unmapped_area(struct file *filp,
>   	loff_t off_align = round_up(off, size);
>   	unsigned long len_pad, ret, off_sub;
>   
> -	if (IS_ENABLED(CONFIG_32BIT) || in_compat_syscall())
> +	if (!IS_ENABLED(CONFIG_64BIT) || in_compat_syscall())
>   		return 0;
>   
>   	if (off_end <= off_align || (off_end - off_align) < size)

Acked-by: David Hildenbrand <david@...hat.com>

-- 
Cheers,

David / dhildenb


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ