mbox series

[kmods,v2,0/4] windows/virt2phys: fix paging issue

Message ID 20210526210147.1287-1-dmitry.kozliuk@gmail.com (mailing list archive)
Headers show
Series windows/virt2phys: fix paging issue | expand

Message

Dmitry Kozlyuk May 26, 2021, 9:01 p.m. UTC
Physical addresses exposed by virt2phys driver could become pageable.
This presents stability and security issues that prevent Microsoft
from signing virt2phys, because a signed driver would be trusted
by all end-user machines.

Ensure that memory for which physical addresses are exposed by
virt2phys is non-pageable at least for the lifetime of the process.
As virt2phys code grows, make its development and debugging easier.

There are other known issues that come from using PA and accessing DMA
from userspace. They are not related to virt2phys par se. It is planned
to address them later by enabling the use of IOMMU for DPDK on Windows.

v2:
    * Following ofline review by DmitryM:
      - Add comment explaining tracking approach for validation team.
      - Replace deprecated allocation API calls.
      - Check properties of locked memory (see docs in patch 3/4).
      - Add configurable limits for tracked processes and memory.
    * Add end-user documentation.
    * Drop patch for Inf2Cat settings UseLocalTime=true:
      the issue it resolves originated from development VM.
    * Add PnpLockdown=1 patch.

Dmitry Kozlyuk (4):
  windows/virt2phys: add PnpLockdown directive
  windows/virt2phys: do not expose pageable physical addresses
  windows/virt2phys: add limits against resource exhaustion
  windows/virt2phys: add tracing

 windows/virt2phys/README.md                 |  38 ++
 windows/virt2phys/virt2phys.c               | 173 ++++++--
 windows/virt2phys/virt2phys.inf             |   1 +
 windows/virt2phys/virt2phys.vcxproj         |   7 +-
 windows/virt2phys/virt2phys.vcxproj.filters |   9 +
 windows/virt2phys/virt2phys_logic.c         | 415 ++++++++++++++++++++
 windows/virt2phys/virt2phys_logic.h         |  39 ++
 windows/virt2phys/virt2phys_trace.h         |  50 +++
 8 files changed, 701 insertions(+), 31 deletions(-)
 create mode 100644 windows/virt2phys/README.md
 create mode 100644 windows/virt2phys/virt2phys_logic.c
 create mode 100644 windows/virt2phys/virt2phys_logic.h
 create mode 100644 windows/virt2phys/virt2phys_trace.h

Comments

Thomas Monjalon June 23, 2021, 7:13 a.m. UTC | #1
26/05/2021 23:01, Dmitry Kozlyuk:
> v2:
>     * Following ofline review by DmitryM:
>       - Add comment explaining tracking approach for validation team.
>       - Replace deprecated allocation API calls.
>       - Check properties of locked memory (see docs in patch 3/4).
>       - Add configurable limits for tracked processes and memory.
>     * Add end-user documentation.
>     * Drop patch for Inf2Cat settings UseLocalTime=true:
>       the issue it resolves originated from development VM.
>     * Add PnpLockdown=1 patch.
> 
> Dmitry Kozlyuk (4):
>   windows/virt2phys: add PnpLockdown directive
>   windows/virt2phys: do not expose pageable physical addresses
>   windows/virt2phys: add limits against resource exhaustion
>   windows/virt2phys: add tracing

Waiting for reviews, especially from Microsoft experts.
Thomas Monjalon Sept. 30, 2021, 8:24 p.m. UTC | #2
23/06/2021 09:13, Thomas Monjalon:
> 26/05/2021 23:01, Dmitry Kozlyuk:
> > v2:
> >     * Following ofline review by DmitryM:
> >       - Add comment explaining tracking approach for validation team.
> >       - Replace deprecated allocation API calls.
> >       - Check properties of locked memory (see docs in patch 3/4).
> >       - Add configurable limits for tracked processes and memory.
> >     * Add end-user documentation.
> >     * Drop patch for Inf2Cat settings UseLocalTime=true:
> >       the issue it resolves originated from development VM.
> >     * Add PnpLockdown=1 patch.
> > 
> > Dmitry Kozlyuk (4):
> >   windows/virt2phys: add PnpLockdown directive
> >   windows/virt2phys: do not expose pageable physical addresses
> >   windows/virt2phys: add limits against resource exhaustion
> >   windows/virt2phys: add tracing
> 
> Waiting for reviews, especially from Microsoft experts.

Why is it taking so long?
Dmitry Kozlyuk Sept. 30, 2021, 8:39 p.m. UTC | #3
2021-09-30 22:24 (UTC+0200), Thomas Monjalon:
> 23/06/2021 09:13, Thomas Monjalon:
> > 26/05/2021 23:01, Dmitry Kozlyuk:  
> > > v2:
> > >     * Following ofline review by DmitryM:
> > >       - Add comment explaining tracking approach for validation team.
> > >       - Replace deprecated allocation API calls.
> > >       - Check properties of locked memory (see docs in patch 3/4).
> > >       - Add configurable limits for tracked processes and memory.
> > >     * Add end-user documentation.
> > >     * Drop patch for Inf2Cat settings UseLocalTime=true:
> > >       the issue it resolves originated from development VM.
> > >     * Add PnpLockdown=1 patch.
> > > 
> > > Dmitry Kozlyuk (4):
> > >   windows/virt2phys: add PnpLockdown directive
> > >   windows/virt2phys: do not expose pageable physical addresses
> > >   windows/virt2phys: add limits against resource exhaustion
> > >   windows/virt2phys: add tracing  
> > 
> > Waiting for reviews, especially from Microsoft experts.  
> 
> Why is it taking so long?

DmitryM, Microsoft expert who suggested this improvement, has been unavailable
until recently. It is expected that he will review this series shortly now.