diff options
author | Ian Moffett <ian@osmora.org> | 2024-03-26 16:21:12 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2024-03-26 16:21:59 -0400 |
commit | 43e2ee7fec3a9464a9c2dcbb9ebac22ada8ce6bf (patch) | |
tree | a267a80cc9c23aaf110b76bee2d8e2fb055b0ae2 /sys/arch/amd64/amd64 | |
parent | d267fcf7b8c8d53a2d1807570c278cf39727eb16 (diff) |
kernel/amd64: tss: Do not allow userspace port I/O
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/arch/amd64/amd64')
-rw-r--r-- | sys/arch/amd64/amd64/tss.c | 4 |
1 files changed, 4 insertions, 0 deletions
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 */ } |