xref: /kernel/linux/linux-6.6/include/linux/elf-randomize.h
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /kernel/linux/linux-6.6/include/linux/
162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci#ifndef _ELF_RANDOMIZE_H
362306a36Sopenharmony_ci#define _ELF_RANDOMIZE_H
462306a36Sopenharmony_ci
562306a36Sopenharmony_cistruct mm_struct;
662306a36Sopenharmony_ci
762306a36Sopenharmony_ci#ifndef CONFIG_ARCH_HAS_ELF_RANDOMIZE
862306a36Sopenharmony_cistatic inline unsigned long arch_mmap_rnd(void) { return 0; }
962306a36Sopenharmony_ci# if defined(arch_randomize_brk) && defined(CONFIG_COMPAT_BRK)
1062306a36Sopenharmony_ci#  define compat_brk_randomized
1162306a36Sopenharmony_ci# endif
1262306a36Sopenharmony_ci# ifndef arch_randomize_brk
1362306a36Sopenharmony_ci#  define arch_randomize_brk(mm)	(mm->brk)
1462306a36Sopenharmony_ci# endif
1562306a36Sopenharmony_ci#else
1662306a36Sopenharmony_ciextern unsigned long arch_mmap_rnd(void);
1762306a36Sopenharmony_ciextern unsigned long arch_randomize_brk(struct mm_struct *mm);
1862306a36Sopenharmony_ci# ifdef CONFIG_COMPAT_BRK
1962306a36Sopenharmony_ci#  define compat_brk_randomized
2062306a36Sopenharmony_ci# endif
2162306a36Sopenharmony_ci#endif
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_ci#endif
24

Indexes created Thu Nov 07 10:32:03 CST 2024