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: Mon, 5 Feb 2024 18:53:24 +0100
From: "Linux regression tracking (Thorsten Leemhuis)"
 <regressions@...mhuis.info>
To: Greg KH <gregkh@...uxfoundation.org>
Cc: jirislaby@...nel.org, surenb@...gle.com, riel@...riel.com,
 willy@...radead.org, cl@...ux.com, akpm@...ux-foundation.org,
 Linux kernel regressions list <regressions@...ts.linux.dev>,
 yang@...amperecomputing.com, linux-mm@...ck.org,
 linux-kernel@...r.kernel.org, "stable@...r.kernel.org"
 <stable@...r.kernel.org>, Sasha Levin <sashal@...nel.org>,
 Yang Shi <shy828301@...il.com>
Subject: Re: [PATCH] mm: huge_memory: don't force huge page alignment on 32
 bit

[adding the stable team]

On 05.02.24 18:07, Yang Shi wrote:
> On Sat, Feb 3, 2024 at 1:24 AM Thorsten Leemhuis
> <regressions@...mhuis.info> wrote:
>> On 18.01.24 14:35, Yang Shi wrote:
>>>
>>> The commit efa7df3e3bb5 ("mm: align larger anonymous mappings on THP
>>> boundaries") caused two issues [1] [2] reported on 32 bit system or compat
>>> userspace.
>>>
>>> It doesn't make too much sense to force huge page alignment on 32 bit
>>> system due to the constrained virtual address space.
>>>
>>> [1] https://lore.kernel.org/linux-mm/CAHbLzkqa1SCBA10yjWTtA2mKCsoK5+M1BthSDL8ROvUq2XxZMw@mail.gmail.com/T/#mf211643a0427f8d6495b5b53f8132f453d60ab95
>>> [2] https://lore.kernel.org/linux-mm/CAHbLzkqa1SCBA10yjWTtA2mKCsoK5+M1BthSDL8ROvUq2XxZMw@mail.gmail.com/T/#me93dff2ccbd9902c3e395e1c022fb454e48ecb1d
>>
>> [FWIW, this is now 4ef9ad19e17676 ("mm: huge_memory: don't force huge
>> page alignment on 32 bit") in mainline]
>>
>> Quick question: it it okay to ask Greg to pick this up for linux-6.7.y
>> series?
> 
> Yes, definitely. Thanks for following up.

In that case: Greg, could you please consider picking up 4ef9ad19e17676
("mm: huge_memory: don't force huge page alignment on 32 bit") for the
next linux-6.7 rc round? tia!

Ohh, and btw: you might also want to pick up c4608d1bf7c653 ("mm: mmap:
map MAP_STACK to VM_NOHUGEPAGE") if you haven't already done so: its
stable tag contains a typo, hence I guess your scripts might have missed
it (I only noticed that by chance).

Ciao, Thorsten

>> I'm wondering because Jiri's report ([1] in above quote) sounded like
>> this is something that will affect and annoy quite a few people with the
>> linux-6.7.y.
>>
>> Ciao, Thorsten
>>
>>> Fixes: efa7df3e3bb5 ("mm: align larger anonymous mappings on THP boundaries")
>>> Reported-by: Jiri Slaby <jirislaby@...nel.org>
>>> Reported-by: Suren Baghdasaryan <surenb@...gle.com>
>>> Tested-by: Jiri Slaby <jirislaby@...nel.org>
>>> Tested-by: Suren Baghdasaryan <surenb@...gle.com>
>>> Cc: Rik van Riel <riel@...riel.com>
>>> Cc: Matthew Wilcox <willy@...radead.org>
>>> Cc: Christopher Lameter <cl@...ux.com>
>>> Signed-off-by: Yang Shi <yang@...amperecomputing.com>
>>> ---
>>>  mm/huge_memory.c | 9 +++++++++
>>>  1 file changed, 9 insertions(+)
>>>
>>> diff --git a/mm/huge_memory.c b/mm/huge_memory.c
>>> index 94ef5c02b459..e9fbaccbe0c0 100644
>>> --- a/mm/huge_memory.c
>>> +++ b/mm/huge_memory.c
>>> @@ -37,6 +37,7 @@
>>>  #include <linux/page_owner.h>
>>>  #include <linux/sched/sysctl.h>
>>>  #include <linux/memory-tiers.h>
>>> +#include <linux/compat.h>
>>>
>>>  #include <asm/tlb.h>
>>>  #include <asm/pgalloc.h>
>>> @@ -811,6 +812,14 @@ static unsigned long __thp_get_unmapped_area(struct file *filp,
>>>       loff_t off_align = round_up(off, size);
>>>       unsigned long len_pad, ret;
>>>
>>> +     /*
>>> +      * It doesn't make too much sense to froce huge page alignment on
>>> +      * 32 bit system or compat userspace due to the contrained virtual
>>> +      * address space and address entropy.
>>> +      */
>>> +     if (IS_ENABLED(CONFIG_32BIT) || in_compat_syscall())
>>> +             return 0;
>>> +
>>>       if (off_end <= off_align || (off_end - off_align) < size)
>>>               return 0;
>>>
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ