From 43e2ee7fec3a9464a9c2dcbb9ebac22ada8ce6bf Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Tue, 26 Mar 2024 16:21:12 -0400 Subject: kernel/amd64: tss: Do not allow userspace port I/O Signed-off-by: Ian Moffett --- sys/arch/amd64/amd64/tss.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/arch/amd64/amd64/tss.c b/sys/arch/amd64/amd64/tss.c index aefc1f2..332bb12 100644 --- a/sys/arch/amd64/amd64/tss.c +++ b/sys/arch/amd64/amd64/tss.c @@ -145,6 +145,7 @@ tss_alloc_stack(union tss_stack *entry_out, size_t size) void write_tss(struct cpu_info *cpu, struct tss_desc *desc) { + volatile struct tss_entry *tss; uintptr_t tss_base; alloc_resources(cpu); @@ -168,4 +169,7 @@ write_tss(struct cpu_info *cpu, struct tss_desc *desc) desc->base_mid8 = __SHIFTOUT(tss_base, __MASK(8) << 16); desc->base_hi_mid8 = __SHIFTOUT(tss_base, __MASK(8) << 24); desc->base_hi32 = __SHIFTOUT(tss_base, __MASK(32) << 32); + + tss = cpu->tss; + tss->io_base = 0xFF; /* Disallow ring 3 port I/O */ } -- cgit v1.2.3