Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'hardening-v5.18-rc1-fix1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux

Pull hardening updates from Kees Cook:
"This addresses an -Warray-bounds warning found under a few ARM
defconfigs, and disables long-broken HARDENED_USERCOPY_PAGESPAN"

* tag 'hardening-v5.18-rc1-fix1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
ARM/dma-mapping: Remove CMA code when not built with CMA
usercopy: Disable CONFIG_HARDENED_USERCOPY_PAGESPAN

+7 -5
+2
arch/arm/mm/dma-mapping.c
··· 381 381 */ 382 382 postcore_initcall(atomic_pool_init); 383 383 384 + #ifdef CONFIG_CMA_AREAS 384 385 struct dma_contig_early_reserve { 385 386 phys_addr_t base; 386 387 unsigned long size; ··· 436 435 iotable_init(&map, 1); 437 436 } 438 437 } 438 + #endif 439 439 440 440 static int __dma_update_pte(pte_t *pte, unsigned long addr, void *data) 441 441 {
+4
arch/arm/mm/mm.h
··· 88 88 89 89 void __init bootmem_init(void); 90 90 void arm_mm_memblock_reserve(void); 91 + #ifdef CONFIG_CMA_AREAS 91 92 void dma_contiguous_remap(void); 93 + #else 94 + static inline void dma_contiguous_remap(void) { } 95 + #endif 92 96 93 97 unsigned long __clear_cr(unsigned long mask);
-4
include/linux/cma.h
··· 12 12 */ 13 13 #ifdef CONFIG_CMA_AREAS 14 14 #define MAX_CMA_AREAS (1 + CONFIG_CMA_AREAS) 15 - 16 - #else 17 - #define MAX_CMA_AREAS (0) 18 - 19 15 #endif 20 16 21 17 #define CMA_MAX_NAME 64
+1 -1
security/Kconfig
··· 166 166 config HARDENED_USERCOPY_PAGESPAN 167 167 bool "Refuse to copy allocations that span multiple pages" 168 168 depends on HARDENED_USERCOPY 169 - depends on EXPERT 169 + depends on BROKEN 170 170 help 171 171 When a multi-page allocation is done without __GFP_COMP, 172 172 hardened usercopy will reject attempts to copy it. There are,