Go to file
Chris von Recklinghausen 1b801fc162 mm: move 'mmap_min_addr' logic from callers into vm_unmapped_area()
JIRA: https://issues.redhat.com/browse/RHEL-27741

commit 6b008640db7355d8de6ac18f74cedd7ccc92684f
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date:   Tue Apr 18 17:40:09 2023 -0400

    mm: move 'mmap_min_addr' logic from callers into vm_unmapped_area()

    Instead of having callers care about the mmap_min_addr logic for the
    lowest valid mapping address (and some of them getting it wrong), just
    move the logic into vm_unmapped_area() itself.  One less thing for various
    architecture cases (and generic helpers) to worry about.

    We should really try to make much more of this be common code, but baby
    steps..

    Without this, vm_unmapped_area() could return an address below
    mmap_min_addr (because some caller forgot about that).  That then causes
    the mmap machinery to think it has found a workable address, but then
    later security_mmap_addr(addr) is unhappy about it and the mmap() returns
    with a nonsensical error (EPERM).

    The proper action is to either return ENOMEM (if the virtual address space
    is exhausted), or try to find another address (ie do a bottom-up search
    for free addresses after the top-down one failed).

    See commit 2afc745f3e ("mm: ensure get_unmapped_area() returns higher
    address than mmap_min_addr"), which fixed this for one call site (the
    generic arch_get_unmapped_area_topdown() fallback) but left other cases
    alone.

    Link: https://lkml.kernel.org/r/20230418214009.1142926-1-Liam.Howlett@oracle.com
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
    Cc: Russell King <linux@armlinux.org.uk>
    Cc: Liam Howlett <liam.howlett@oracle.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

Signed-off-by: Chris von Recklinghausen <crecklin@redhat.com>
2024-04-30 07:01:05 -04:00
Documentation mm: add new KSM process and sysfs knobs 2024-04-30 07:01:04 -04:00
LICENSES LICENSES/dual/CC-BY-4.0: Git rid of "smart quotes" 2021-07-15 06:31:24 -06:00
arch mm: move 'mmap_min_addr' logic from callers into vm_unmapped_area() 2024-04-30 07:01:05 -04:00
block Merge: Updates for powerpc smp nr_cpu_ids 2024-04-22 12:47:54 +00:00
certs integrity: PowerVM support for loading third party code signing keys 2024-02-05 19:05:32 +08:00
crypto Merge: crypto: dh - implement FIPS PCT and a panic on a failure 2024-03-20 13:38:07 -03:00
drivers mm: shrinkers: convert shrinker_rwsem to mutex 2024-04-30 07:00:16 -04:00
fs mm: move 'mmap_min_addr' logic from callers into vm_unmapped_area() 2024-04-30 07:01:05 -04:00
include mm: add new KSM process and sysfs knobs 2024-04-30 07:01:04 -04:00
init init,mm: fold late call to page_ext_init() to page_alloc_init_late() 2024-04-30 07:00:33 -04:00
io_uring eventfd: simplify eventfd_signal_mask() 2024-04-15 19:14:00 +02:00
ipc ipc/shm: introduce new do_vma_munmap() to munmap 2024-04-29 14:33:14 -04:00
kernel mm: add new api to enable ksm per process 2024-04-30 07:01:04 -04:00
lib lib/show_mem.c: use for_each_populated_zone() simplify code 2024-04-30 07:01:02 -04:00
mm mm: move 'mmap_min_addr' logic from callers into vm_unmapped_area() 2024-04-30 07:01:05 -04:00
net mm: replace vma->vm_flags direct modifications with modifier calls 2024-04-29 14:33:17 -04:00
redhat zsmalloc: make zspage chain size configurable 2024-04-29 14:33:11 -04:00
samples kmemleak-test: fix kmemleak_test.c build logic 2024-04-30 07:00:50 -04:00
scripts kasan: treat meminstrinsic as builtins in uninstrumented files 2024-04-29 14:33:25 -04:00
security mm: replace vma->vm_flags direct modifications with modifier calls 2024-04-29 14:33:17 -04:00
sound mm: replace vma->vm_flags direct modifications with modifier calls 2024-04-29 14:33:17 -04:00
tools mm: discard __GFP_ATOMIC 2024-04-29 14:33:09 -04:00
usr shmbuf.h: add asm/shmbuf.h to UAPI compile-test coverage 2024-03-20 09:42:28 -04:00
virt eventfd: simplify eventfd_signal() 2024-04-15 19:14:00 +02:00
.clang-format cpumask: re-introduce constant-sized cpumask optimizations 2024-03-20 09:42:41 -04:00
.cocciconfig
.get_maintainer.conf get_maintainer.conf: Update with new location of RHMAINTAINERS 2022-01-19 14:26:16 -05:00
.get_maintainer.ignore
.gitattributes gitattributes: Remove unnecesary export restrictions 2021-08-30 10:50:35 -04:00
.gitignore kbuild: Cleanup DT Overlay intermediate files as appropriate 2024-03-15 14:47:39 -05:00
.gitlab-ci.yml gitlab-ci: allow coverage template to disable debug builds again 2024-04-09 14:39:33 +02:00
.mailmap mailmap: remove my redhat.com address from RHEL9's .mailmap file 2022-09-26 09:34:38 -04:00
COPYING COPYING: state that all contributions really are covered by this file 2020-02-10 13:32:20 -08:00
CREDITS MAINTAINERS: Orphan Cadence PCIe IP 2024-02-25 08:39:32 -07:00
Kbuild kbuild: rename hostprogs-y/always to hostprogs/always-y 2020-02-04 01:53:07 +09:00
Kconfig Introduce CONFIG_RH_DISABLE_DEPRECATED 2021-08-30 10:50:55 -04:00
Kconfig.redhat redhat: kABI: add missing RH_KABI_SIZE_ALIGN_CHECKS Kconfig option 2024-01-12 14:27:16 +01:00
MAINTAINERS MAINTAINERS: extend memblock entry to include MM initialization 2024-04-30 07:00:34 -04:00
Makefile redhat: version two of Makefile.rhelver tweaks 2024-04-09 19:15:12 -04:00
Makefile.rhelver [redhat] kernel-5.14.0-444.el9 2024-04-26 10:03:10 -03:00
README
makefile redhat: Change Makefile target names to dist- 2021-08-30 10:50:11 -04:00

README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.