Re: [patch] x86: fix ESP corruption CPU bug

From: Pavel Machek
Date: Sun Mar 13 2005 - 15:12:19 EST


Hi!

> @@ -257,8 +265,31 @@
> movl TI_flags(%ebp), %ecx
> testw $_TIF_ALLWORK_MASK, %cx # current->work
> jne syscall_exit_work
> +
> restore_all:
> - RESTORE_ALL
> + movl EFLAGS(%esp), %eax # mix EFLAGS, SS and CS
> + movb OLDSS(%esp), %ah
> + movb CS(%esp), %al
> + andl $(VM_MASK | (4 << 8) | 3), %eax
> + cmpl $((4 << 8) | 3), %eax
> + je ldt_ss # returning to user-space with LDT SS

All common linux apps use same %ss, no? Perhaps it would be more
efficient to just check if %ss == 0x7b, and proceed directly to
restore_nocheck if not?

Or perhaps we could only enable this code after application loads
custom ldt?

Pavel

--
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
-
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/