Pull s390 updates from Vasily Gorbik: - Add support for stackleak feature. Also allow specifying architecture-specific stackleak poison function to enable faster implementation. On s390, the mvc-based implementation helps decrease typical overhead from a factor of 3 to just 25% - Convert all assembler files to use SYM* style macros, deprecating the ENTRY() macro and other annotations. Select ARCH_USE_SYM_ANNOTATIONS - Improve KASLR to also randomize module and special amode31 code base load addresses - Rework decompressor memory tracking to support memory holes and improve error handling - Add support for protected virtualization AP binding - Add support for set_direct_map() calls - Implement set_memory_rox() and noexec module_alloc() - Remove obsolete overriding of mem*() functions for KASAN - Rework kexec/kdump to avoid using nodat_stack to call purgatory - Convert the rest of the s390 code to use flexible-array member instead of a zero-length array - Clean up uaccess inline asm - Enable ARCH_HAS_MEMBARRIER_SYNC_CORE - Convert to using CONFIG_FUNCTION_ALIGNMENT and enable DEBUG_FORCE_FUNCTION_ALIGN_64B - Resolve last_break in userspace fault reports - Simplify one-level sysctl registration - Clean up branch prediction handling - Rework CPU counter facility to retrieve available counter sets just once - Other various small fixes and improvements all over the code * tag 's390-6.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (118 commits) s390/stackleak: provide fast __stackleak_poison() implementation stackleak: allow to specify arch specific stackleak poison function s390: select ARCH_USE_SYM_ANNOTATIONS s390/mm: use VM_FLUSH_RESET_PERMS in module_alloc() s390: wire up memfd_secret system call s390/mm: enable ARCH_HAS_SET_DIRECT_MAP s390/mm: use BIT macro to generate SET_MEMORY bit masks s390/relocate_kernel: adjust indentation s390/relocate_kernel: use SYM* macros instead of ENTRY(), etc. s390/entry: use SYM* macros instead of ENTRY(), etc. s390/purgatory: use SYM* macros instead of ENTRY(), etc. s390/kprobes: use SYM* macros instead of ENTRY(), etc. s390/reipl: use SYM* macros instead of ENTRY(), etc. s390/head64: use SYM* macros instead of ENTRY(), etc. s390/earlypgm: use SYM* macros instead of ENTRY(), etc. s390/mcount: use SYM* macros instead of ENTRY(), etc. s390/crc32le: use SYM* macros instead of ENTRY(), etc. s390/crc32be: use SYM* macros instead of ENTRY(), etc. s390/crypto,chacha: use SYM* macros instead of ENTRY(), etc. s390/amode31: use SYM* macros instead of ENTRY(), etc. ...
Showing the changes to kernel (1 of 99 files). Show all
Unified · Split
| @@ -70,6 +70,18 @@ late_initcall(stackleak_sysctls_init); · 69 unmodified lines | ||
| 70 | 70 | #define skip_erasing() false |
| 71 | 71 | #endif /* CONFIG_STACKLEAK_RUNTIME_DISABLE */ |
| 72 | 72 | |
| 73 | +#ifndef __stackleak_poison | |
| 74 | +static __always_inline void __stackleak_poison(unsigned long erase_low, | |
| 75 | + unsigned long erase_high, | |
| 76 | + unsigned long poison) | |
| 77 | +{ | |
| 78 | + while (erase_low < erase_high) { | |
| 79 | + *(unsigned long *)erase_low = poison; | |
| 80 | + erase_low += sizeof(unsigned long); | |
| 81 | + } | |
| 82 | +} | |
| 83 | +#endif | |
| 84 | + | |
| 73 | 85 | static __always_inline void __stackleak_erase(bool on_task_stack) |
| 74 | 86 | { |
| 75 | 87 | const unsigned long task_stack_low = stackleak_task_low_bound(current); |
| @@ -101,10 +113,7 @@ static __always_inline void __stackleak_erase(bool on_task_stack) · 25 unmodified lines | ||
| 101 | 113 | else |
| 102 | 114 | erase_high = task_stack_high; |
| 103 | 115 | |
| 104 | − while (erase_low < erase_high) { | |
| 105 | − *(unsigned long *)erase_low = STACKLEAK_POISON; | |
| 106 | − erase_low += sizeof(unsigned long); | |
| 107 | − } | |
| 116 | + __stackleak_poison(erase_low, erase_high, STACKLEAK_POISON); | |
| 108 | 117 | |
| 109 | 118 | /* Reset the 'lowest_stack' value for the next syscall */ |
| 110 | 119 | current->lowest_stack = task_stack_high; |