Patch series "Provide generic top-down mmap layout functions", v6. This series introduces generic functions to make top-down mmap layout easily accessible to architectures, in particular riscv which was the initial goal of this series. The generic implementation was taken from arm64 and used successively by arm, mips and finally riscv. Note that in addition the series fixes 2 issues: - stack randomization was taken into account even if not necessary. - [1] fixed an issue with mmap base which did not take into account randomization but did not report it to arm and mips, so by moving arm64 into a generic library, this problem is now fixed for both architectures. This work is an effort to factorize architecture functions to avoid code duplication and oversights as in [1]. [1]: https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1429066.html This patch (of 14): This preparatory commit moves this function so that further introduction of generic topdown mmap layout is contained only in mm/util.c.
Showing the changes to include/linux (1 of 3 files). Show all
Unified · Split
| @@ -2328,6 +2328,8 @@ extern int install_special_mapping(struct mm_struct *mm, · 2327 unmodified lines | |||
| 2328 | unsigned long addr, unsigned long len, | 2328 | unsigned long addr, unsigned long len, |
| 2329 | unsigned long flags, struct page **pages); | 2329 | unsigned long flags, struct page **pages); |
| 2330 | 2330 | ||
| 2331 | unsigned long randomize_stack_top(unsigned long stack_top); | ||
| 2332 | |||
| 2331 | extern unsigned long get_unmapped_area(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); | 2333 | extern unsigned long get_unmapped_area(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); |
| 2332 | 2334 | ||
| 2333 | extern unsigned long mmap_region(struct file *file, unsigned long addr, | 2335 | extern unsigned long mmap_region(struct file *file, unsigned long addr, |