Merge: x86/mm: Fix a kdump kernel failure on SME system when CONFIG_IMA_KEXEC=y

MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/5874

```
JIRA: https://issues.redhat.com/browse/RHEL-39727
Upstream Status: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git

This fixes a sme blocker bug. W/o this fix, kdump kernel on SME system
can't boot up successfully. With the fix, kdump kernel works well.

Signed-off-by: Baoquan He <bhe@redhat.com>
```

Approved-by: Waiman Long <longman@redhat.com>
Approved-by: Herton R. Krzesinski <herton@redhat.com>
Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com>

Merged-by: Rado Vrbovsky <rvrbovsk@redhat.com>
This commit is contained in:
Rado Vrbovsky 2024-11-27 11:19:39 +00:00
commit fd7d9b2656
1 changed files with 4 additions and 2 deletions

View File

@ -655,7 +655,8 @@ static bool memremap_is_setup_data(resource_size_t phys_addr,
paddr_next = data->next;
len = data->len;
if ((phys_addr > paddr) && (phys_addr < (paddr + len))) {
if ((phys_addr > paddr) &&
(phys_addr < (paddr + sizeof(struct setup_data) + len))) {
memunmap(data);
return true;
}
@ -717,7 +718,8 @@ static bool __init early_memremap_is_setup_data(resource_size_t phys_addr,
paddr_next = data->next;
len = data->len;
if ((phys_addr > paddr) && (phys_addr < (paddr + len))) {
if ((phys_addr > paddr) &&
(phys_addr < (paddr + sizeof(struct setup_data) + len))) {
early_memunmap(data, sizeof(*data));
return true;
}