From patchwork Thu Aug 13 23:21:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Narcisa Ana Maria Vasile X-Patchwork-Id: 75527 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 69F94A04B1; Fri, 14 Aug 2020 01:24:02 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E605F1C136; Fri, 14 Aug 2020 01:22:56 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by dpdk.org (Postfix) with ESMTP id EB4CC1C0D2 for ; Fri, 14 Aug 2020 01:22:44 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1059) id C090020B4918; Thu, 13 Aug 2020 16:22:43 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com C090020B4918 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1597360963; bh=o9F3SfmbvtdoEhQhrzNxos1Y9SEqNdD4/z/Caj2hVVw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PCA/d480YIkj4/cfh3e5N6di4amo+0D9obgPBUuW9D+LwJSjsGu+MA2rgsgz8HNli oNB4QNQqdlym7X+4/8I9vx3N5z4iCKH+xZBaszRtXgzfvf1+sLff/+OcuX27ATHOfx VOFhn4A0wB742Lp7JRKIAJiHg21cwF4lvZaIo9h0= From: Narcisa Ana Maria Vasile To: dev@dpdk.org, thomas@monjalon.net, haramakr@linux.microsoft.com, ocardona@microsoft.com, pallavi.kadam@intel.com, dmitry.kozliuk@gmail.com Cc: ranjit.menon@intel.com, dmitrym@microsoft.com, Harini Ramakrishnan Date: Thu, 13 Aug 2020 16:21:30 -0700 Message-Id: <1597360905-74106-8-git-send-email-navasile@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1597360905-74106-1-git-send-email-navasile@linux.microsoft.com> References: <1597360905-74106-1-git-send-email-navasile@linux.microsoft.com> Subject: [dpdk-dev] [PATCH 07/22] doc: change the Windows UIO driver's default security descriptor to admin only X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Harini Ramakrishnan --- kernel/windows/netuio/netuio_dev.c | 54 +++++++++++++++++------------- 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/kernel/windows/netuio/netuio_dev.c b/kernel/windows/netuio/netuio_dev.c index 10ff5f903..4d8b9430d 100644 --- a/kernel/windows/netuio/netuio_dev.c +++ b/kernel/windows/netuio/netuio_dev.c @@ -32,37 +32,43 @@ netuio_create_device(_Inout_ PWDFDEVICE_INIT DeviceInit) NTSTATUS status; PAGED_CODE(); - WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&deviceAttributes, NETUIO_CONTEXT_DATA); - // Set the device context cleanup callback. - // This function will be called when the WDF Device Object associated to the current device is destroyed - deviceAttributes.EvtCleanupCallback = netuio_evt_device_context_cleanup; + // Ensure that only administrators can access our device object. + status = WdfDeviceInitAssignSDDLString(DeviceInit, &SDDL_DEVOBJ_SYS_ALL_ADM_ALL); - status = WdfDeviceCreate(&DeviceInit, &deviceAttributes, &device); + if (NT_SUCCESS(status)) { + WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&deviceAttributes, NETUIO_CONTEXT_DATA); - if (NT_SUCCESS(status)) { - // Create a device interface so that applications can find and talk to us. - status = WdfDeviceCreateDeviceInterface(device, &GUID_DEVINTERFACE_netUIO, NULL); + // Set the device context cleanup callback. + // This function will be called when the WDF Device Object associated to the current device is destroyed + deviceAttributes.EvtCleanupCallback = netuio_evt_device_context_cleanup; - if (NT_SUCCESS(status)) { - // Retrieve and store PCI information - status = get_pci_device_info(device); - } + status = WdfDeviceCreate(&DeviceInit, &deviceAttributes, &device); + } - if (NT_SUCCESS(status)) { - // Create a symbolic link name for user-space access - status = create_device_specific_symbolic_link(device); - } + if (NT_SUCCESS(status)) { + // Create a device interface so that applications can find and talk to us. + status = WdfDeviceCreateDeviceInterface(device, &GUID_DEVINTERFACE_netUIO, NULL); + } - if (NT_SUCCESS(status)) { - // Initialize the I/O Package and any Queues - status = netuio_queue_initialize(device); - } + if (NT_SUCCESS(status)) { + // Retrieve and store PCI information + status = get_pci_device_info(device); + } - if (NT_SUCCESS(status)) { - // Allocate physically contiguous memory for user process use. We'll map it later - status = allocate_usermemory_segment(device); - } + if (NT_SUCCESS(status)) { + // Create a symbolic link name for user-space access + status = create_device_specific_symbolic_link(device); + } + + if (NT_SUCCESS(status)) { + // Initialize the I/O Package and any Queues + status = netuio_queue_initialize(device); + } + + if (NT_SUCCESS(status)) { + // Allocate physically contiguous memory for user process use. We'll map it later + status = allocate_usermemory_segment(device); } return status;