Interrupt::IsEnabled() makes assumptions about the stack pointer
The inline assembly
unsigned long is_enabled; asm("pushf\t\n" "pop %0\t\n" "and $0x000200, %0" : "=r"(is_enabled));
makes the assumption that it can just use the stack like this, but due to things like the red zone, it cannot, and it's poor style to bypass the compiler like this anyway. There is a slight problem as pushf is the only simple way I can think off the top of my head to get the flags register, and that uses the stack, but maybe there's another instruction. (Why isn't there a mov for this? Maybe there is with a specific destination register) A workaround could simply be to preserve the stack pointer register, store the of the a destination address in the stack register, pushf, and then restore the stack. But that causes problems if an interrupt happens at this point and the stack is wrong. Hmm.
Labeling as security as it's possible the current code might clobber something on the kernel stack with unintended consequences.