From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753340AbdBIPuR (ORCPT ); Thu, 9 Feb 2017 10:50:17 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:34004 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751030AbdBIPuP (ORCPT ); Thu, 9 Feb 2017 10:50:15 -0500 Subject: Re: [PATCH 2/3] xen/privcmd: Add IOCTL_PRIVCMD_DM_OP To: Paul Durrant , "xen-devel@lists.xenproject.org" , "linux-kernel@vger.kernel.org" References: <1486649866-4869-1-git-send-email-paul.durrant@citrix.com> <1486649866-4869-3-git-send-email-paul.durrant@citrix.com> <8ef1299559e24d96ba8bbab49baee5ae@AMSPEX02CL03.citrite.net> Cc: Juergen Gross From: Boris Ostrovsky Message-ID: Date: Thu, 9 Feb 2017 10:50:06 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <8ef1299559e24d96ba8bbab49baee5ae@AMSPEX02CL03.citrite.net> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/09/2017 09:27 AM, Paul Durrant wrote: >> -----Original Message----- >> From: Paul Durrant [mailto:paul.durrant@citrix.com] >> Sent: 09 February 2017 14:18 >> To: xen-devel@lists.xenproject.org; linux-kernel@vger.kernel.org >> Cc: Paul Durrant ; Boris Ostrovsky >> ; Juergen Gross >> Subject: [PATCH 2/3] xen/privcmd: Add IOCTL_PRIVCMD_DM_OP >> >> Recently a new dm_op[1] hypercall was added to Xen to provide a >> mechanism >> for restricting device emulators (such as QEMU) to a limited set of >> hypervisor operations, and being able to audit those operations in the >> kernel of the domain in which they run. >> >> This patch adds IOCTL_PRIVCMD_DM_OP as gateway for >> __HYPERVISOR_dm_op, >> bouncing the callers buffers through kernel memory to allow the address >> ranges to be audited (and negating the need to bounce through locked >> memory in user-space). > > Actually, it strikes me (now that I've posted the patch) that I should probably just mlock the user buffers rather than bouncing them through kernel... Anyway, I'd still appreciate review on other aspects of the patch. Are you suggesting that the caller (user) mlocks the buffers? -boris