From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753996AbdBIQpg convert rfc822-to-8bit (ORCPT ); Thu, 9 Feb 2017 11:45:36 -0500 Received: from smtp.eu.citrix.com ([185.25.65.24]:46181 "EHLO SMTP.EU.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753952AbdBIQpe (ORCPT ); Thu, 9 Feb 2017 11:45:34 -0500 X-IronPort-AV: E=Sophos;i="5.35,137,1484006400"; d="scan'208";a="40491054" From: Paul Durrant To: "'Boris Ostrovsky'" , "xen-devel@lists.xenproject.org" , "linux-kernel@vger.kernel.org" CC: Juergen Gross Subject: RE: [PATCH 2/3] xen/privcmd: Add IOCTL_PRIVCMD_DM_OP Thread-Topic: [PATCH 2/3] xen/privcmd: Add IOCTL_PRIVCMD_DM_OP Thread-Index: AQHSgt9MHqxKS5zAUkK8Qkq5Zb3F16FguzgQgAAGowCAAB/T8A== Date: Thu, 9 Feb 2017 16:45:22 +0000 Message-ID: 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> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: Boris Ostrovsky [mailto:boris.ostrovsky@oracle.com] > Sent: 09 February 2017 15:50 > To: Paul Durrant ; xen-devel@lists.xenproject.org; > linux-kernel@vger.kernel.org > Cc: Juergen Gross > Subject: Re: [PATCH 2/3] xen/privcmd: Add IOCTL_PRIVCMD_DM_OP > > > > 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? No, I meant calling get_user_pages() (which AIUI is essentially what the internals of sys_mlock does) on the buffers to make sure they don't get paged during execution of the (unlocked) ioctl. Paul > > -boris