Merge tag 'rodata-v4.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux

Pull rodata updates from Kees Cook:
 "This renames the (now inaccurate) DEBUG_RODATA and related
  SET_MODULE_RONX configs to the more sensible STRICT_KERNEL_RWX and
  STRICT_MODULE_RWX"

* tag 'rodata-v4.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
  arch: Rename CONFIG_DEBUG_RODATA and CONFIG_DEBUG_MODULE_RONX
  arch: Move CONFIG_DEBUG_RODATA and CONFIG_SET_MODULE_RONX to be common
This commit is contained in:
Linus Torvalds
2017-02-21 17:56:45 -08:00
33 changed files with 90 additions and 109 deletions

View File

@@ -1051,21 +1051,9 @@ config ARCH_SUPPORTS_BIG_ENDIAN
This option specifies the architecture can support big endian
operation.
config DEBUG_RODATA
bool "Make kernel text and rodata read-only"
depends on MMU && !XIP_KERNEL
default y if CPU_V7
help
If this is set, kernel text and rodata memory will be made
read-only, and non-text kernel memory will be made non-executable.
The tradeoff is that each region is padded to section-size (1MiB)
boundaries (because their permissions are different and splitting
the 1M pages into 4K ones causes TLB performance problems), which
can waste memory.
config DEBUG_ALIGN_RODATA
bool "Make rodata strictly non-executable"
depends on DEBUG_RODATA
depends on STRICT_KERNEL_RWX
default y
help
If this is set, rodata will be made explicitly non-executable. This

View File

@@ -572,7 +572,7 @@ void __init mem_init(void)
}
}
#ifdef CONFIG_DEBUG_RODATA
#ifdef CONFIG_STRICT_KERNEL_RWX
struct section_perm {
const char *name;
unsigned long start;
@@ -741,7 +741,7 @@ void set_kernel_text_ro(void)
#else
static inline void fix_kernmem_perms(void) { }
#endif /* CONFIG_DEBUG_RODATA */
#endif /* CONFIG_STRICT_KERNEL_RWX */
void free_tcmmem(void)
{