Skip to content

Commit f87cbd0

Browse files
committed
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
2 parents 2975dbd + 229a08a commit f87cbd0

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

Diff for: arch/arm/mm/dma-mapping.c

+2
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,7 @@ static int __init atomic_pool_init(void)
381381
*/
382382
postcore_initcall(atomic_pool_init);
383383

384+
#ifdef CONFIG_CMA_AREAS
384385
struct dma_contig_early_reserve {
385386
phys_addr_t base;
386387
unsigned long size;
@@ -435,6 +436,7 @@ void __init dma_contiguous_remap(void)
435436
iotable_init(&map, 1);
436437
}
437438
}
439+
#endif
438440

439441
static int __dma_update_pte(pte_t *pte, unsigned long addr, void *data)
440442
{

Diff for: arch/arm/mm/mm.h

+4
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ extern phys_addr_t arm_lowmem_limit;
8888

8989
void __init bootmem_init(void);
9090
void arm_mm_memblock_reserve(void);
91+
#ifdef CONFIG_CMA_AREAS
9192
void dma_contiguous_remap(void);
93+
#else
94+
static inline void dma_contiguous_remap(void) { }
95+
#endif
9296

9397
unsigned long __clear_cr(unsigned long mask);

Diff for: include/linux/cma.h

-4
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212
*/
1313
#ifdef CONFIG_CMA_AREAS
1414
#define MAX_CMA_AREAS (1 + CONFIG_CMA_AREAS)
15-
16-
#else
17-
#define MAX_CMA_AREAS (0)
18-
1915
#endif
2016

2117
#define CMA_MAX_NAME 64

Diff for: security/Kconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ config HARDENED_USERCOPY
166166
config HARDENED_USERCOPY_PAGESPAN
167167
bool "Refuse to copy allocations that span multiple pages"
168168
depends on HARDENED_USERCOPY
169-
depends on EXPERT
169+
depends on BROKEN
170170
help
171171
When a multi-page allocation is done without __GFP_COMP,
172172
hardened usercopy will reject attempts to copy it. There are,

0 commit comments

Comments
 (0)