apsun / loliOS

Lightweight & operational Linux-inspired OS.
33 stars 1 forks source link

Callee-save registers being clobbered when entering userspace #12

Closed apsun closed 7 years ago

apsun commented 7 years ago

This is very dangerous. Since we don't restore ebx/esi/edi as the caller of process_run expects, we could corrupt the registers in the kernel if the way GCC arranges our variables changes. We should explicitly surround the call to process_run with clobbers.

apsun commented 7 years ago

Fixed in r11951.