Skip to content

Commit

Permalink
Merge tag 'hardening-v5.18-rc1-fix1' of git://git.kernel.org/pub/scm/…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
torvalds committed Mar 31, 2022
2 parents 2975dbd + 229a08a commit f87cbd0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions arch/arm/mm/dma-mapping.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ static int __init atomic_pool_init(void)
*/
postcore_initcall(atomic_pool_init);

#ifdef CONFIG_CMA_AREAS
struct dma_contig_early_reserve {
phys_addr_t base;
unsigned long size;
Expand Down Expand Up @@ -435,6 +436,7 @@ void __init dma_contiguous_remap(void)
iotable_init(&map, 1);
}
}
#endif

static int __dma_update_pte(pte_t *pte, unsigned long addr, void *data)
{
Expand Down
4 changes: 4 additions & 0 deletions arch/arm/mm/mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ extern phys_addr_t arm_lowmem_limit;

void __init bootmem_init(void);
void arm_mm_memblock_reserve(void);
#ifdef CONFIG_CMA_AREAS
void dma_contiguous_remap(void);
#else
static inline void dma_contiguous_remap(void) { }
#endif

unsigned long __clear_cr(unsigned long mask);
4 changes: 0 additions & 4 deletions include/linux/cma.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
*/
#ifdef CONFIG_CMA_AREAS
#define MAX_CMA_AREAS (1 + CONFIG_CMA_AREAS)

#else
#define MAX_CMA_AREAS (0)

#endif

#define CMA_MAX_NAME 64
Expand Down
2 changes: 1 addition & 1 deletion security/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ config HARDENED_USERCOPY
config HARDENED_USERCOPY_PAGESPAN
bool "Refuse to copy allocations that span multiple pages"
depends on HARDENED_USERCOPY
depends on EXPERT
depends on BROKEN
help
When a multi-page allocation is done without __GFP_COMP,
hardened usercopy will reject attempts to copy it. There are,
Expand Down

0 comments on commit f87cbd0

Please sign in to comment.