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] [day] [month] [year] [list]
Message-ID: <CAHbLzkq_NHZdxNcWD-WXLEP+DRUGcNsavH6uMTAGdgXrwjX24Q@mail.gmail.com>
Date: Fri, 12 Jul 2024 08:31:02 -0700
From: Yang Shi <shy828301@...il.com>
To: Yves-Alexis Perez <corsac@...ian.org>
Cc: Matthew Wilcox <willy@...radead.org>, jirislaby@...nel.org, surenb@...gle.com, 
	riel@...riel.com, cl@...ux.com, akpm@...ux-foundation.org, 
	yang@...amperecomputing.com, linux-mm@...ck.org, linux-kernel@...r.kernel.org, 
	Salvatore Bonaccorso <carnil@...ian.org>, Ben Hutchings <ben@...adent.org.uk>
Subject: Re: [PATCH] mm: huge_memory: don't force huge page alignment on 32 bit

On Fri, Jul 12, 2024 at 7:43 AM Yves-Alexis Perez <corsac@...ian.org> wrote:
>
> On Thu, Jul 11, 2024 at 01:53:04PM -0700, Yang Shi wrote:
> > On Thu, Jul 11, 2024 at 1:50 PM Matthew Wilcox <willy@...radead.org> wrote:
> > >
> > > On Thu, Jul 11, 2024 at 01:47:00PM -0700, Yang Shi wrote:
> > > > +++ b/mm/huge_memory.c
> > > > @@ -857,7 +857,8 @@ 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_32BIT) || IS_ENABLED(CONFIG_X86_32) ||
> > > > +           in_compat_syscall())
> > >
> > > Why not:
> > >
> > >         if (!IS_ENABLED(CONFIG_64BIT) || in_compat_syscall())
> >
> > Nothing specific, just didn't think of it, sigh...
> >
> > Thanks for the suggestion. Definitely preferable way.
> >
> And I just did a quick test rebuilding a kernel with
> !IS_ENABLED(CONFIG_64BIT) and running on an i386 Debian sid
> installation.
>
> I can confirm it seems to work as intended:
>
> Before:
> root@...tvm:~# uname -a
> Linux testvm 6.9.8-686-pae #1 SMP PREEMPT_DYNAMIC Debian 6.9.8-1 (2024-07-07) i686 GNU/Linux
> root@...tvm:~# for i in {0..9}; do cat /proc/self/maps |grep libc.so |head -n1; done
> b7c00000-b7c22000 r--p 00000000 fe:00 933        /usr/lib/i386-linux-gnu/libc.so.6
> b7c00000-b7c22000 r--p 00000000 fe:00 933        /usr/lib/i386-linux-gnu/libc.so.6
> b7c00000-b7c22000 r--p 00000000 fe:00 933        /usr/lib/i386-linux-gnu/libc.so.6
> b7c00000-b7c22000 r--p 00000000 fe:00 933        /usr/lib/i386-linux-gnu/libc.so.6
> b7c00000-b7c22000 r--p 00000000 fe:00 933        /usr/lib/i386-linux-gnu/libc.so.6
> b7c00000-b7c22000 r--p 00000000 fe:00 933        /usr/lib/i386-linux-gnu/libc.so.6
> b7c00000-b7c22000 r--p 00000000 fe:00 933        /usr/lib/i386-linux-gnu/libc.so.6
> b7c00000-b7c22000 r--p 00000000 fe:00 933        /usr/lib/i386-linux-gnu/libc.so.6
> b7c00000-b7c22000 r--p 00000000 fe:00 933        /usr/lib/i386-linux-gnu/libc.so.6
> b7c00000-b7c22000 r--p 00000000 fe:00 933        /usr/lib/i386-linux-gnu/libc.so.6
>
>
> After:
>
> root@...tvm:~# uname -a
> Linux testvm 6.9.8+ #1 SMP PREEMPT_DYNAMIC Fri Jul 12 15:23:07 CEST 2024 i686 GNU/Linux
> root@...tvm:~# for i in {0..9}; do cat /proc/self/maps |grep libc.so |head -n1; done
> b7cf3000-b7d15000 r--p 00000000 fe:00 933        /usr/lib/i386-linux-gnu/libc.so.6
> b7d7a000-b7d9c000 r--p 00000000 fe:00 933        /usr/lib/i386-linux-gnu/libc.so.6
> b7d8b000-b7dad000 r--p 00000000 fe:00 933        /usr/lib/i386-linux-gnu/libc.so.6
> b7d4b000-b7d6d000 r--p 00000000 fe:00 933        /usr/lib/i386-linux-gnu/libc.so.6
> b7d64000-b7d86000 r--p 00000000 fe:00 933        /usr/lib/i386-linux-gnu/libc.so.6
> b7d15000-b7d37000 r--p 00000000 fe:00 933        /usr/lib/i386-linux-gnu/libc.so.6
> b7c9e000-b7cc0000 r--p 00000000 fe:00 933        /usr/lib/i386-linux-gnu/libc.so.6
> b7d68000-b7d8a000 r--p 00000000 fe:00 933        /usr/lib/i386-linux-gnu/libc.so.6
> b7cf6000-b7d18000 r--p 00000000 fe:00 933        /usr/lib/i386-linux-gnu/libc.so.6
> b7ce6000-b7d08000 r--p 00000000 fe:00 933        /usr/lib/i386-linux-gnu/libc.so.6
>
> So:
> Tested-By: Yves-Alexis Perez <corsac@...ian.org>

Thank you so much. Will submit the formal patch soon.

>
> I didn't try on other 32b architectures though.
>
> Regards,
> --
> Yves-Alexis Perez

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ