Re: sys_execve leaking rbp/rbx/r12-15 to the new process?

From: Ingo Molnar
Date: Sat Apr 04 2015 - 10:04:27 EST



* Denys Vlasenko <dvlasenk@xxxxxxxxxx> wrote:

> We can do this instead:
>
> ENTRY(stub_execve)
> CFI_STARTPROC
> call sys_execve
> testl %eax, %eax
> jz 1f
> ret
> 1: addq $8, %rsp
> xorl %ebx, %ebx // maybe create a macro for zeroing these
> xorl %ebp, %ebp //
> xorl %r12d, %r12d //
> xorl %r13d, %r13d //
> xorl %r14d, %r14d //
> xorl %r15d, %r15d //

Yeah, call it ZERO_EXTRA_REGS or so.

> Any reason we should not do this change?

Not that I can see - lets try it.

Thanks,

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/