diff options
| author | Thorsten Blum <blum@kernel.org> | 2026-09-18 16:27:13 +0200 |
|---|---|---|
| committer | Borislav Petkov (AMD) <bp@alien8.de> | 2026-11-06 09:05:23 -0800 |
| commit | cb319926808b1cca522d2087a13205e840beb45b (patch) | |
| tree | 85b520c0f06418218284b2917088f7b06f9f1738 /scripts/dummy-tools/python3 | |
| parent | b73fdd0f49e175dd733650669193c1504d283955 (diff) | |
x86/boot: Fix off-by-one error in sme_clear_pgd()
The mapping helpers __sme_map_range_pmd() and __sme_map_range_pte(), and
therefore sme_encrypt_kernel(), use exclusive end addresses and stop
before vaddr reaches vaddr_end.
However, sme_clear_pgd() treats vaddr_end as inclusive when calculating
the last PGD entry to clear. If vaddr_end is PGD-aligned, the first PGD
entry outside the range is cleared too.
Use vaddr_end - 1 to calculate the last PGD entry within the range.
Fixes: 6ebcb060713f ("x86/mm: Add support to encrypt the kernel in-place")
Signed-off-by: Thorsten Blum <blum@kernel.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Cc: <stable@kernel.org>
Link: https://patch.msgid.link/20260918142714.242711-2-blum@kernel.org
Diffstat (limited to 'scripts/dummy-tools/python3')
0 files changed, 0 insertions, 0 deletions
