]> git.baikalelectronics.ru Git - kernel.git/commit
x86/cpu_entry_area: Prevent wraparound in setup_cpu_entry_area_ptes() on 32bit
authorThomas Gleixner <tglx@linutronix.de>
Sat, 23 Dec 2017 18:45:11 +0000 (19:45 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Sat, 23 Dec 2017 19:18:42 +0000 (20:18 +0100)
commit7cd68a89b9dc1a441abddd4fb8b733cedacf68b6
tree51356ab92d31c42e817b02ded05fe2dad0d17a81
parent966bec40d835209f06454905664c0fd2826b821a
x86/cpu_entry_area: Prevent wraparound in setup_cpu_entry_area_ptes() on 32bit

The loop which populates the CPU entry area PMDs can wrap around on 32bit
machines when the number of CPUs is small.

It worked wonderful for NR_CPUS=64 for whatever reason and the moron who
wrote that code did not bother to test it with !SMP.

Check for the wraparound to fix it.

Fixes: e5b3723bb96e ("x86/cpu_entry_area: Move it out of the fixmap")
Reported-by: kernel test robot <fengguang.wu@intel.com>
Signed-off-by: Thomas "Feels stupid" Gleixner <tglx@linutronix.de>
Tested-by: Borislav Petkov <bp@alien8.de>
arch/x86/mm/cpu_entry_area.c