Subject: Re: non-exec stack problems with multithreaded programs
To: Matthias Drochner <M.Drochner@fz-juelich.de>
From: Chuck Silvers <chuq@chuq.com>
List: port-i386
Date: 12/06/2003 18:08:40
hi,

(sorry for not getting back to you earlier, been busy)

On Fri, Dec 05, 2003 at 08:16:42PM +0100, Matthias Drochner wrote:
> Looking at the issue, I found some things which are suboptimal
> or which I just don't understand:
> -code segment descriptors are used inconsistently: initially
>  from the LDT, later from the GDT

I don't know about this part, I'm a little fuzzy on the *DT stuff.
all the other segment registers are set up using the GDT, why would
CS be different?


> -pmap_exec_fixup() will never revoke anything, there is dead code

I'm not sure what you mean by this, the current code will reset CS
to the non-exec-stack version (GUCODE_SEL) if it can.


> -pmap_update_pg() is called for exec permission changes. Since
>  this is a software-only flag, it looks like a waste.

yea, I don't know what that was for either, now that you mention it.


> -the CS in the PCB doesn't seem to ge good for anything

pcb_cs is defined as

#define pcb_cs  pcb_tss.__tss_cs

isn't the CS in the TSS used?

-Chuck