Page 1 of 1

ldt???

Posted: Wed Apr 24, 2002 11:00 pm
by blito
hi :-)
if i define an LDG selector in the GDT. Example : 0x8
with CPL=3, any program can access it???.
i don´t understand where lies the protection.
please could anybody help me!!!.
i'm in troubles.

RE:ldt??? (need confirmation!)

Posted: Wed Apr 24, 2002 11:00 pm
by J. Weeks
>On 2002-04-25 06:55:42, blito wrote:
>hi :-)
>if i define an LDG selector in the GDT. Example : 0x8
>with CPL=3, any program can access it???.

You define LDT descriptors in the GDT, and provide
RPL's not CPL's. You can set the LDT's descriptor
to RPL=0, if you want. The OS is the only one
that can execute the LDTR instruction anyway,
so it's rather pointless to have an RPL of anything
more than 0 for an LDT descriptor.

>i don´t understand where lies the protection.

Just set RPL=0 so only the OS can access. Your
applications can still use the LDT, because inside
the LDT you provide other descriptors to memory
address. THOSE descriptors can have
an RPL of 3, if you want.

>please could anybody help me!!!.
>i'm in troubles.

Hmm... I'm pretty sure that's accurate, but now
I'm starting to doubt myself (I never used
LDT's, myself). Can anybody confirm any of the
above?

Thanks,
Jeff

RE:ldt??? (need confirmation!)

Posted: Thu Apr 25, 2002 11:00 pm
by than's jeff i'll try it.
>On 2002-04-25 17:57:38, J. Weeks wrote:
>>On 2002-04-25 06:55:42, blito wrote:
>>hi :-)
>>if i define an LDG selector in the GDT. Example : 0x8
>>with CPL=3, any program can access it???.
>
>You define LDT descriptors in the GDT, and provide
>RPL's not CPL's. You can set the LDT's descriptor
>to RPL=0, if you want. The OS is the only one
>that can execute the LDTR instruction anyway,
>so it's rather pointless to have an RPL of anything
>more than 0 for an LDT descriptor.
>
>>i don´t understand where lies the protection.
>
>Just set RPL=0 so only the OS can access. Your
>applications can still use the LDT, because inside
>the LDT you provide other descriptors to memory
>address. THOSE descriptors can have
>an RPL of 3, if you want.
>
>>please could anybody help me!!!.
>>i'm in troubles.
>
>Hmm... I'm pretty sure that's accurate, but now
>I'm starting to doubt myself (I never used
>LDT's, myself). Can anybody confirm any of the
>above?
>
>Thanks,
>Jeff

than's jeff i'll try it.

Posted: Thu Apr 25, 2002 11:00 pm
by blito
>On 2002-04-25 17:57:38, J. Weeks wrote:
>>On 2002-04-25 06:55:42, blito wrote:
>>hi :-)
>>if i define an LDG selector in the GDT. Example : 0x8
>>with CPL=3, any program can access it???.
>
>You define LDT descriptors in the GDT, and provide
>RPL's not CPL's. You can set the LDT's descriptor
>to RPL=0, if you want. The OS is the only one
>that can execute the LDTR instruction anyway,
>so it's rather pointless to have an RPL of anything
>more than 0 for an LDT descriptor.
>
>>i don´t understand where lies the protection.
>
>Just set RPL=0 so only the OS can access. Your
>applications can still use the LDT, because inside
>the LDT you provide other descriptors to memory
>address. THOSE descriptors can have
>an RPL of 3, if you want.
>
>>please could anybody help me!!!.
>>i'm in troubles.
>
>Hmm... I'm pretty sure that's accurate, but now
>I'm starting to doubt myself (I never used
>LDT's, myself). Can anybody confirm any of the
>above?
>
>Thanks,
>Jeff