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: <Zo0JSVzKKmG_1ADQ@localhost.localdomain>
Date: Tue, 9 Jul 2024 11:56:25 +0200
From: Oscar Salvador <osalvador@...e.de>
To: Donet Tom <donettom@...ux.ibm.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
	Muchun Song <muchun.song@...ux.dev>,
	"Kirill A . Shutemov" <kirill.shutemov@...ux.intel.com>,
	linux-mm@...ck.org, linux-kernel@...r.kernel.org,
	Ritesh Harjani <ritesh.list@...il.com>,
	Mike Rapoport <rppt@...nel.org>,
	David Hildenbrand <david@...hat.com>,
	Matthew Wilcox <willy@...radead.org>,
	Tony Battersby <tonyb@...ernetics.com>,
	"Aneesh Kumar K . V" <aneesh.kumar@...nel.org>,
	Nicholas Piggin <npiggin@...il.com>,
	Alexei Starovoitov <ast@...nel.org>,
	Andy Lutomirski <luto@...nel.org>
Subject: Re: [PATCH v2] fs/hugetlbfs/inode.c: Ensure
 generic_hugetlb_get_unmapped_area() returns higher address than
 mmap_min_addr

On Tue, Jul 09, 2024 at 04:21:22AM -0500, Donet Tom wrote:
> generic_hugetlb_get_unmapped_area() was returning an address less
> than mmap_min_addr if the mmap argument addr, after alignment, was
> less than mmap_min_addr, causing mmap to fail.
> 
> This is because current generic_hugetlb_get_unmapped_area() code does
> not take into account mmap_min_addr.
> 
> This patch ensures that generic_hugetlb_get_unmapped_area() always returns
> an address that is greater than mmap_min_addr. Additionally, similar to
> generic_get_unmapped_area(), vm_end_gap() checks are included to ensure
> that the address is within the limit.

Hi Donet,

jfyi: I am already working on other parts of the kernel to avoid hugetlb code
duplication vs mm core.
I am also working on getting rid of hugetlb-unmapped_area specific code
[1].
I still need to perform some more tests but looks promising
code-deletion-wise:

  arch/parisc/mm/hugetlbpage.c     |  23 -------
  arch/powerpc/mm/book3s64/slice.c |  49 ++++++++------
  arch/s390/mm/hugetlbpage.c       |  84 ------------------------
  arch/s390/mm/mmap.c              |  14 +++-
  arch/sparc/kernel/sys_sparc_32.c |  16 +++--
  arch/sparc/kernel/sys_sparc_64.c |  36 ++++++++---
  arch/sparc/mm/hugetlbpage.c      | 108 -------------------------------
  arch/x86/kernel/sys_x86_64.c     |  27 +++++---
  arch/x86/mm/hugetlbpage.c        | 100 ----------------------------
  fs/hugetlbfs/inode.c             |  97 ++-------------------------
  include/linux/hugetlb.h          |  10 +++
  mm/mmap.c                        |  25 ++++++-
  12 files changed, 139 insertions(+), 450 deletions(-)

I plan to post it in a day or two.

[1] https://github.com/leberus/linux/tree/hugetlb-unmapped-area


-- 
Oscar Salvador
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ