Skip to content

Commit a4bffb1

Browse files
author
Chris von Recklinghausen
committed
mm: huge_memory: use !CONFIG_64BIT to relax huge page alignment on 32 bit machines
JIRA: https://issues.redhat.com/browse/RHEL-54027 CVE: CVE-2024-42258 commit d959202 Author: Yang Shi <yang@os.amperecomputing.com> Date: Fri Jul 12 08:58:55 2024 -0700 mm: huge_memory: use !CONFIG_64BIT to relax huge page alignment on 32 bit machines Yves-Alexis Perez reported commit 4ef9ad1 ("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/ Link: https://lkml.kernel.org/r/20240712155855.1130330-1-yang@os.amperecomputing.com Fixes: 4ef9ad1 ("mm: huge_memory: don't force huge page alignment on 32 bit") Signed-off-by: Yang Shi <yang@os.amperecomputing.com> Reported-by: Yves-Alexis Perez <corsac@debian.org> Tested-by: Yves-Alexis Perez <corsac@debian.org> Acked-by: David Hildenbrand <david@redhat.com> Cc: Ben Hutchings <ben@decadent.org.uk> Cc: Christoph Lameter <cl@linux.com> Cc: Jiri Slaby <jirislaby@kernel.org> Cc: Matthew Wilcox (Oracle) <willy@infradead.org> Cc: Rik van Riel <riel@surriel.com> Cc: Salvatore Bonaccorso <carnil@debian.org> Cc: Suren Baghdasaryan <surenb@google.com> Cc: <stable@vger.kernel.org> [6.8+] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Chris von Recklinghausen <crecklin@redhat.com>
1 parent 76b28d3 commit a4bffb1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/huge_memory.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ static unsigned long __thp_get_unmapped_area(struct file *filp,
607607
loff_t off_align = round_up(off, size);
608608
unsigned long len_pad, ret;
609609

610-
if (IS_ENABLED(CONFIG_32BIT) || in_compat_syscall())
610+
if (!IS_ENABLED(CONFIG_64BIT) || in_compat_syscall())
611611
return 0;
612612

613613
if (off_end <= off_align || (off_end - off_align) < size)

0 commit comments

Comments
 (0)