Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp214359pxb; Wed, 14 Apr 2021 13:25:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8odGQF/oGfID1HsVZ4PhQDqV3UMVwtOAIGQdcDzPlyz3C4rdPqUF/Qqy77Kl4N3lk1kfv X-Received: by 2002:a05:6402:4314:: with SMTP id m20mr21281edc.5.1618431956110; Wed, 14 Apr 2021 13:25:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618431956; cv=none; d=google.com; s=arc-20160816; b=fFOhhkRKcrhPLKNXx+W8imt18YFzOAzLduOwAFUuSR4bQHwU2DsS570eIZu/z8A5GF Y2iFMjpSefC7n8hFzhGOT7bTrCoNxtYf4VbDIDBHJkVGy7mSMSGUMlwDPH5nASYExJNX E3B9XCJGG4NBCkifNi+MIL9Ugwf6fJSlbXHj1cwzOjUX1OzNSZF9vDJ6BtKMW2DN/UT1 huBKcsrEvD459HHSoIFWWTzgvX+G/H1fWREQ9TneidNlVVE4SqhfZV9OaLlvpE6r60XD ayon9VZRLwOAV+gkiTWpdxqRneF2+dkFUn94VFWTxlMPXWNQfx1GWYM7sjBWgGVD0nIz 21eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=J4JhOYx+tiJgg3bjn6CHtvMKIfhPLnczRDg7CTeeJNo=; b=F4q69NZZTbLON5oAh83QBDgGlYiAZ6xG+xPYnOH2m3mtM9m4L5QiUHN2xptcxFQB60 LW1Z1t47c0b41VRN7kQSJtyD4YkLenm3M/moDKoyRQUmWfUqp9isnyLqgI2831M5eATL 1jEPw0g1Z96K3gdar8S0OipbW2CDLjf/n0C1YkB/tu297lGQQYWyBPZ8e0x5S8AL7dx0 mdvsGeqq4p5VIZ2ISduqZBOMt3VaSFueG20R2uDdJIB4oAOcg60H+8zaE837S1R3leA4 TibKF6OQZIQYgpL4ah1nCr/qUM+X2k/p/mMAQZisAS6ZToK6+afbl7O12RRXhcRJNPfx Ptrw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b10si372743ejj.523.2021.04.14.13.25.32; Wed, 14 Apr 2021 13:25:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348720AbhDNHfN (ORCPT + 99 others); Wed, 14 Apr 2021 03:35:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347823AbhDNHfM (ORCPT ); Wed, 14 Apr 2021 03:35:12 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72989C061574; Wed, 14 Apr 2021 00:34:51 -0700 (PDT) Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.94) (envelope-from ) id 1lWa2r-00BW2q-RV; Wed, 14 Apr 2021 09:34:42 +0200 Message-ID: <9f8280540bbc6f3c857ac5749eeafcd145577da3.camel@sipsolutions.net> Subject: Re: [PATCH 0/4 POC] Allow executing code and syscalls in another address space From: Johannes Berg To: Anton Ivanov , Andrei Vagin , linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, Benjamin Berg Cc: linux-um@lists.infradead.org, criu@openvz.org, avagin@google.com, Andrew Morton , Andy Lutomirski , Christian Brauner , Dmitry Safonov <0x7f454c46@gmail.com>, Ingo Molnar , Jeff Dike , Mike Rapoport , Michael Kerrisk , Oleg Nesterov , Peter Zijlstra , Richard Weinberger , Thomas Gleixner Date: Wed, 14 Apr 2021 09:34:40 +0200 In-Reply-To: <78cdee11-1923-595f-90d2-e236efbafa6a@cambridgegreys.com> References: <20210414055217.543246-1-avagin@gmail.com> <78cdee11-1923-595f-90d2-e236efbafa6a@cambridgegreys.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.4 (3.38.4-1.fc33) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-malware-bazaar: not-scanned Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2021-04-14 at 08:22 +0100, Anton Ivanov wrote: > On 14/04/2021 06:52, Andrei Vagin wrote: > > We already have process_vm_readv and process_vm_writev to read and write > > to a process memory faster than we can do this with ptrace. And now it > > is time for process_vm_exec that allows executing code in an address > > space of another process. We can do this with ptrace but it is much > > slower. > > > > = Use-cases = > > > > Here are two known use-cases. The first one is “application kernel” > > sandboxes like User-mode Linux and gVisor. In this case, we have a > > process that runs the sandbox kernel and a set of stub processes that > > are used to manage guest address spaces. Guest code is executed in the > > context of stub processes but all system calls are intercepted and > > handled in the sandbox kernel. Right now, these sort of sandboxes use > > PTRACE_SYSEMU to trap system calls, but the process_vm_exec can > > significantly speed them up. > > Certainly interesting, but will require um to rework most of its memory > management and we will most likely need extra mm support to make use of > it in UML. We are not likely to get away just with one syscall there. Might help the seccomp mode though: https://patchwork.ozlabs.org/project/linux-um/list/?series=231980 johannes