[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH V2] kdd.c: Add support for initial handshake in KD protocol for Win 7, 8 and 10 (64 bit)



On 11/13/19 10:55 PM, Julian Tuminaro wrote:

From: Julian Tuminaro and Jenish Rakholiya <julian.tuminaro@xxxxxxxxx and rakholiyajenish.07@xxxxxxxxx>

Current implementation of find_os is based on the hard-coded values for
different Windows version. It uses the value for get the address to
start looking for DOS header in the given specified range. However, this
is not scalable to all version of Windows as it will require us to keep
adding new entries and also due to KASLR, chances of not hitting the PE
header is significant. We implement a way for 64-bit systems to use IDT
entry to get a valid exception/interrupt handler and then move back into
the memory to find the valid DOS header. Since IDT entries are protected
by PatchGuard, we think our assumption that IDT entries will not be
corrupted is valid for our purpose. Once we have the image base, we
search for the DBGKD_GET_VERSION64 structure type in .data section to
get information required for handshake.

Currently, this is a work in progress feature and current patch only
supports the handshake and memory read/write on 64-bit systems.

NOTE: This is the Updated version of the previous patch submitted
NOTE: This has currently been only tested when debugging was not enabled
on the guest Windows.

Signed-off-by: Jenish Rakholiya <rjenish@xxxxxxx>
Signed-off-by: Julian Tuminaro <jtuminar@xxxxxxxxxxxxxx>
---

This commit has broken the build of the staging tree. For a full log see: https://gitlab.com/xen-project/xen/-/jobs/365398313#L5184 But the relevant bit is likely:

gcc -m32 -march=i686 -DBUILD_ID -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wdeclaration-after-statement -Wno-unused-but-set-variable -Wno-unused-local-typedefs -O2 -fomit-frame-pointer -D__XEN_INTERFACE_VERSION__=__XEN_LATEST_INTERFACE_VERSION__ -MMD -MF .kdd-xen.o.d -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -mno-tls-direct-seg-refs -Werror -I/builds/xen-project/xen/tools/debugger/kdd/../../../tools/libxc/include -I/builds/xen-project/xen/tools/debugger/kdd/../../../tools/libs/toollog/include -I/builds/xen-project/xen/tools/debugger/kdd/../../../tools/include -I/builds/xen-project/xen/tools/debugger/kdd/../../../tools/libs/foreignmemory/include -I/builds/xen-project/xen/tools/debugger/kdd/../../../tools/include -I/builds/xen-project/xen/tools/debugger/kdd/../../../tools/libs/devicemodel/include -I/builds/xen-project/xen/tools/debugger/kdd/../../../tools/include -I/builds/xen-project/xen/tools/debugger/kdd/../../../tools/include -D__XEN_TOOLS__ -DXC_WANT_COMPAT_MAP_FOREIGN_API -c -o kdd-xen.o kdd-xen.c
In file included from kdd.c:53:0:
kdd.c: In function 'get_os_info_64':
kdd.c:616:35: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
 KDD_LOG(s, "idt0 addr: %p\n", (void *)idt0_addr);

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.