Skip to content

Commit e2bf95a

Browse files
committed
Merge: x86/tdx: Fix "in-kernel MMIO" check
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/6616 JIRA: https://issues.redhat.com/browse/RHEL-63318 CVE: CVE-2024-47727 Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Approved-by: Maxim Levitsky <mlevitsk@redhat.com> Approved-by: Emanuele Giuseppe Esposito <eesposit@redhat.com> Approved-by: Paolo Bonzini <bonzini@gnu.org> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Augusto Caringi <acaringi@redhat.com>
2 parents d9eb6f2 + 9056622 commit e2bf95a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

arch/x86/coco/tdx/tdx.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <asm/insn-eval.h>
1717
#include <asm/pgtable.h>
1818
#include <asm/set_memory.h>
19+
#include <asm/traps.h>
1920

2021
/* MMIO direction */
2122
#define EPT_READ 0
@@ -532,6 +533,11 @@ static int handle_mmio(struct pt_regs *regs, struct ve_info *ve)
532533
return -EINVAL;
533534
}
534535

536+
if (!fault_in_kernel_space(ve->gla)) {
537+
WARN_ONCE(1, "Access to userspace address is not supported");
538+
return -EINVAL;
539+
}
540+
535541
/*
536542
* Reject EPT violation #VEs that split pages.
537543
*

0 commit comments

Comments
 (0)