Article View: comp.os.ms-windows.programmer.vxd
Article #2Re: Ring 0 access from within a ring 3 program without VxD
From: Geoff Chappell
Date: Mon, 21 Dec 1998 00:00
Date: Mon, 21 Dec 1998 00:00
37 lines
2621 bytes
2621 bytes
William DePalo [MVP] wrote in message
<#QTDW8xK#GA.145@uppssnewspub04.moswest.msn.net>...
>Not to be outdone Pietrek improved on Schmidt's improvements in his
book
>Windows 95 Systems Programming Secrets published by IDG
(ISBN:1-56884-318-6)
Unfortunately, the method is fundamentally flawed, and is easily seen to
be if you look at it from the perspective of the VMM. On page 302, Matt
Pietrek writes
I bracketed the call gate call with cli and sti to prevent
interrupts in the ring 0 code. This eliminates the problem
of switching to a safe stack once we're in ring 0 code.
The danger here is that readers may interpret this as suggesting that
disabling interrupts is a mere convenience. Let it be stressed that
disabling interrupts is no mere convenience: it is essential. Worse,
even disabling interrupts is not, strictly speaking, sufficient.
The problem is this. If you enable interrupts, a hardware interrupt may
occur. (Even with interrupts disabled, the same arguments apply to CPU
exceptions and NMIs, but let's leave them for now.) The VxD that handles
that interrupt may schedule an event callback at which to do further
work. The VxD is entitled to believe that ring 3 code cannot execute
without the VMM processing events on the way back to ring 3. Some VxDs
do indeed act on this belief. However, in this scheme, the return to
ring 3 occurs without the VMM's involvement. The scheme may therefore
confuse VxDs that are going about their legitimate business. As such,
the scheme is fundamentally defective.
----
Geoff Chappell
Consulting Software Analyst
email: geoffch@ozemail.com.au
web: http://www.ozemail.com.au/~geoffch
Technical Details
Message-ID:
<75m005$eh6$2@reader1.reader.news.ozemail.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<75eeoj$hga$1@mercurio.cica.es> <#QTDW8xK#GA.145@uppssnewspub04.moswest.msn.net>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 114950,99c580e8472a97b6 X-Google-Attributes: gid114950,public X-Google-Thread: 113dfb,99c580e8472a97b6 X-Google-Attributes: gid113dfb,public X-Google-Thread: fd2c4,99c580e8472a97b6 X-Google-Attributes: gidfd2c4,public X-Google-Thread: 10d088,99c580e8472a97b6 X-Google-Attributes: gid10d088,public From: "Geoff Chappell" <geoffch@no.junk.mail.please> Subject: Re: Ring 0 access from within a ring 3 program without VxD Date: 1998/12/21 Message-ID: <75m005$eh6$2@reader1.reader.news.ozemail.net> X-Deja-AN: 424549944 References: <75eeoj$hga$1@mercurio.cica.es> <#QTDW8xK#GA.145@uppssnewspub04.moswest.msn.net> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Organization: OzEmail Ltd. Newsgroups: comp.os.ms-windows.programmer.vxd,comp.os.ms-windows.programmer.win32,es.comp.os.ms-windows.programacion,microsoft.public.win32.programmer.kernel