Skip to content

x86/mm: backport fixes for CVE-2023-0597 and CVE-2023-3640

Vasiliy Kovalev stable 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest5 patches 0 repliesNew
  2. v15 patches 0 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5x86/kasan: Map shadow for percpu pages on demandarch/x86/include/asm/kasan.h arch/x86/mm/cpu_entry_area.c arch/x86/mm/kasan_init_64.c+22 -40 replies
2/5x86/mm: Recompute physical address for every page of per-CPU CEA mappingarch/x86/mm/cpu_entry_area.c+1 -10 replies
3/5x86/mm: Populate KASAN shadow for entire per-CPU range of CPU entry areaarch/x86/mm/cpu_entry_area.c+3 -50 replies
4/5x86/mm: Randomize per-cpu entry areaarch/x86/include/asm/cpu_entry_area.h arch/x86/include/asm/pgtable_areas.h arch/x86/kernel/hw_breakpoint.c +1 more+51 -100 replies
5/5x86/mm: Do not shuffle CPU entry areas without KASLRarch/x86/mm/cpu_entry_area.c+7 -00 replies

Reviews trailers per patch

3 of 5 patches have a Reviewed-by or Acked-by.

PatchYujie LiuAndrey RyabininKees Cook
1/5T-b
2/5R-b
3/5R-b
4/5R-b
5/5

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [PATCH v2 5.10/5.15/6.1 0/5] x86/mm: backport fixes for CVE-2023-0597 and CVE-2023-3640

v1: https://lore.kernel.org/all/[email protected]/

v2: fix the regression causing kernel boot failures when both CONFIG_RANDOMIZE_BASE=y and CONFIG_KASAN=y are enabled, instead of backporting commit d4150779e60f ("random32: use real rng for non-deterministic randomness"), which would bring in additional fixing commits:

4051a81774d6 ("locking/lockdep: Use sched_clock() for random numbers") 327b18b7aaed ("mm/kfence: select random number before taking raw lock") f05ccf6a6ac6 ("crypto: testmgr - fix RNG performance in fuzz tests")

replaced the random number generator function (prandom -> random) with in commit dcd5ba760e89 ("x86/mm: Randomize per-cpu entry area"):

- cea = prandom_u32_max(max_cea);
+ cea = (u32)(((u64) get_random_u32() * max_cea) >> 32);

This change will replicate the behavior as if the fixing
commit d4150779e60f ("random32: use real rng for non-deterministic randomness") had been applied.

[PATCH v2 5.10/5.15/6.1 1/5] x86/kasan: Map shadow for percpu pages on demand [PATCH v2 5.10/5.15/6.1 2/5] x86/mm: Recompute physical address for every page of [PATCH v2 5.10/5.15/6.1 3/5] x86/mm: Populate KASAN shadow for entire per-CPU range of [PATCH v2 5.10/5.15/6.1 4/5] x86/mm: Randomize per-cpu entry area
[PATCH v2 5.10/5.15/6.1 5/5] x86/mm: Do not shuffle CPU entry areas without KASLR