coconut-svsm / svsm

COCONUT-SVSM
MIT License
104 stars 40 forks source link

Kernel security features #448

Open p4zuu opened 2 weeks ago

p4zuu commented 2 weeks ago

I think we can start tracking down the security features we could add to the COCONUT kernel to improve its security:

This list aims to be as complete as possible, so please comment or reach me if you want to add or modify elements from the list, or would like to assign yourself to a task :)

Freax13 commented 2 weeks ago

Shadow stacks :)

00xc commented 2 weeks ago

We could look into LLVM's KCFI.

Also we could perhaps consider a KPTI-like mechanism depending on our threat model regarding userspace.

Freax13 commented 2 weeks ago

Rust has (unstable) support for KASAN.

p4zuu commented 2 weeks ago

Rust has (unstable) support for KASAN.

KASAN would be very useful in testing env indeed, I'll track it here too. @00xc already had a look into KASAN but struggled a bit with the linker as far as I remember. In any cases, we would still have to write the KASAN handlers ourselves, right?

Freax13 commented 2 weeks ago

I have a working implementation of KASAN in mushroom.

In any cases, we would still have to write the KASAN handlers ourselves, right?

Yes, there's an interface that has to implemented by the kernel.

p4zuu commented 2 weeks ago

I have a working implementation of KASAN in mushroom.

Nice!

00xc commented 2 weeks ago

Other than the linking issues I had some boot hangs. I managed to get a working build by disabling stack instrumentation. I did not start the actual implementation though.

I'm not sure if I can recover the changes required but it was mostly defining the required symbols and adding some flags to the build command.

Freax13 commented 2 weeks ago

We could extend our elf loader to support RELRO.

Freax13 commented 2 weeks ago

I'd like to take a stab at shadow stacks.