linux-stable/arch
Tom Lendacky 7ca5e95f2a x86/sev: Fix calculation of end address based on number of pages
[ Upstream commit 5dee19b6b2 ]

When calculating an end address based on an unsigned int number of pages,
any value greater than or equal to 0x100000 that is shift PAGE_SHIFT bits
results in a 0 value, resulting in an invalid end address. Change the
number of pages variable in various routines from an unsigned int to an
unsigned long to calculate the end address correctly.

Fixes: 5e5ccff60a ("x86/sev: Add helper for validating pages in early enc attribute changes")
Fixes: dc3f3d2474 ("x86/mm: Validate memory when changing the C-bit")
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/6a6e4eea0e1414402bac747744984fa4e9c01bb6.1686063086.git.thomas.lendacky@amd.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-07-19 16:20:55 +02:00
..
alpha mm/fault: convert remaining simple cases to lock_mm_and_find_vma() 2023-07-01 13:16:25 +02:00
arc mm/fault: convert remaining simple cases to lock_mm_and_find_vma() 2023-07-01 13:16:25 +02:00
arm arm/mm: Convert to using lock_mm_and_find_vma() 2023-07-01 13:16:25 +02:00
arm64 arm64/mm: Convert to using lock_mm_and_find_vma() 2023-07-01 13:16:24 +02:00
csky csky: fix up lock_mm_and_find_vma() conversion 2023-07-01 13:16:27 +02:00
hexagon mm/fault: convert remaining simple cases to lock_mm_and_find_vma() 2023-07-01 13:16:25 +02:00
ia64 mm: always expand the stack with the mmap write lock held 2023-07-01 13:16:25 +02:00
loongarch mm/fault: convert remaining simple cases to lock_mm_and_find_vma() 2023-07-01 13:16:25 +02:00
m68k mm: always expand the stack with the mmap write lock held 2023-07-01 13:16:25 +02:00
microblaze mm: always expand the stack with the mmap write lock held 2023-07-01 13:16:25 +02:00
mips mips/mm: Convert to using lock_mm_and_find_vma() 2023-07-01 13:16:24 +02:00
nios2 mm/fault: convert remaining simple cases to lock_mm_and_find_vma() 2023-07-01 13:16:25 +02:00
openrisc mm: always expand the stack with the mmap write lock held 2023-07-01 13:16:25 +02:00
parisc parisc: fix expand_stack() conversion 2023-07-01 13:16:26 +02:00
powerpc powerpc/mm: convert coprocessor fault to lock_mm_and_find_vma() 2023-07-01 13:16:25 +02:00
riscv riscv/mm: Convert to using lock_mm_and_find_vma() 2023-07-01 13:16:24 +02:00
s390 mm: always expand the stack with the mmap write lock held 2023-07-01 13:16:25 +02:00
sh mm/fault: convert remaining simple cases to lock_mm_and_find_vma() 2023-07-01 13:16:25 +02:00
sparc sparc32: fix lock_mm_and_find_vma() conversion 2023-07-01 13:16:26 +02:00
um mm: always expand the stack with the mmap write lock held 2023-07-01 13:16:25 +02:00
x86 x86/sev: Fix calculation of end address based on number of pages 2023-07-19 16:20:55 +02:00
xtensa mm/fault: convert remaining simple cases to lock_mm_and_find_vma() 2023-07-01 13:16:25 +02:00
.gitignore
Kconfig ftrace: Allow WITH_ARGS flavour of graph tracer with shadow call stack 2022-12-31 13:32:45 +01:00