mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2026-11-08 18:57:22 +00:00
x86/sev: Fix calculation of end address based on number of pages
[ Upstream commit5dee19b6b2] 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>
This commit is contained in:
parent
3376c4fe2d
commit
fe3592a1fc
2 changed files with 15 additions and 15 deletions
Loading…
Add table
Add a link
Reference in a new issue