From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 84CD3C433E2 for ; Fri, 4 Sep 2020 14:39:07 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1CC5F206F2 for ; Fri, 4 Sep 2020 14:39:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="Hwm/hipx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1CC5F206F2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9677C6B005A; Fri, 4 Sep 2020 10:39:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9176D6B0068; Fri, 4 Sep 2020 10:39:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 805E76B006C; Fri, 4 Sep 2020 10:39:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0019.hostedemail.com [216.40.44.19]) by kanga.kvack.org (Postfix) with ESMTP id 6801E6B005A for ; Fri, 4 Sep 2020 10:39:06 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 24C478245571 for ; Fri, 4 Sep 2020 14:39:06 +0000 (UTC) X-FDA: 77225636292.13.quill11_4a03433270b3 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id E5B8C18140B60 for ; Fri, 4 Sep 2020 14:39:05 +0000 (UTC) X-HE-Tag: quill11_4a03433270b3 X-Filterd-Recvd-Size: 4746 Received: from mail-qt1-f195.google.com (mail-qt1-f195.google.com [209.85.160.195]) by imf24.hostedemail.com (Postfix) with ESMTP for ; Fri, 4 Sep 2020 14:39:05 +0000 (UTC) Received: by mail-qt1-f195.google.com with SMTP id b3so4700388qtg.13 for ; Fri, 04 Sep 2020 07:39:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=wDmkQHwEcY2XRhrLIEh8Bubr2jk1fGPsnbn+CUF1gC0=; b=Hwm/hipxtv14300WHvMwkXx4tHR1WqhdtdLWGqKlllTJm6nYDPZCmS2XOBwC+XKKf1 YtUaqZTjp1g9YRR9pHraQvgUDjDrPrRzoBvbA5xEIejDqfkxOfzpoCquqsPTohQaowEO 1jbtwZIzJRgb/qERCNK5ZX+qcfPjuTL7YDJV9pD4z0Z7/EzNzvznvtW/V8AQ8m9fc0PS JMqTPQ1JkMbFMUwX4rvJmfh0/EQHgDrI/rx+LDv5KAnDD6wgkncIUXDf2QBP0UnCLjG/ cMutfPXuEc3eM7fQGF940STrQcr407UrAvqmYZPzIQZb2Oe4gK0SVr5UkJngvETOWQLh KkBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=wDmkQHwEcY2XRhrLIEh8Bubr2jk1fGPsnbn+CUF1gC0=; b=DEEJxp/7ieD7T03bM80XysDmqUwtvGOmwM97COfC8c2LQWfq0A4E8BWjgMVIBHUcpi 6D2XWNgPH9clmwZyGJvHV3GDfZoY9MiBhucON72BB/t/wY85iKgCnvL+7jXY5f8WymNH sQHg6YS7WktSmeJ6e8FEw9mBeS3BZV69Vc+jwMTEA1uJqrfHekkBpIR3/LSXHIIL44br DEuCVBMZ8AnnUTW1iDF3G/YspPWI4WE2rJUmU4ivoD0C+w8EJPhgFO9O1sWTJ0KQWSWC PkahX2JFWobRPKurkrqr6EtFYFmZv0YHhjg/FOQ0dKgzcbc+PjUw6HWTStq/+h8OuNKz XK6w== X-Gm-Message-State: AOAM5329NzF5S+9YmjkTEEdk5seHK230SDVqfP2oDR8WwKt5W1Pu1GIH AVZDI2ZNFZ9w64A/+8RAyEQ6Vw== X-Google-Smtp-Source: ABdhPJx2gfE56WEtnLuU3mS+tp1h1ay/F6XI1JmBGe3AskxgKplYS+YyVe+ew4QvzZ8paoG2uOBVWQ== X-Received: by 2002:aed:3461:: with SMTP id w88mr8847483qtd.180.1599230344762; Fri, 04 Sep 2020 07:39:04 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-48-30.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.48.30]) by smtp.gmail.com with ESMTPSA id l19sm4791162qtu.16.2020.09.04.07.39.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Sep 2020 07:39:04 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1kECrn-007eyn-Gz; Fri, 04 Sep 2020 11:39:03 -0300 Date: Fri, 4 Sep 2020 11:39:03 -0300 From: Jason Gunthorpe To: Mircea CIRJALIU - MELIU Cc: Adalbert =?utf-8?B?TGF6xINy?= , "linux-mm@kvack.org" , "linux-api@vger.kernel.org" , Andrew Morton , Alexander Graf , Stefan Hajnoczi , Jerome Glisse , Paolo Bonzini , Mihai =?utf-8?B?RG9uyJt1?= , Andy Lutomirski , Arnd Bergmann , Sargun Dhillon , Aleksa Sarai , Oleg Nesterov , Jann Horn , Kees Cook , Matthew Wilcox , Christian Brauner Subject: Re: [RESEND RFC PATCH 0/5] Remote mapping Message-ID: <20200904143903.GT24045@ziepe.ca> References: <20200904113116.20648-1-alazar@bitdefender.com> <20200904121148.GR24045@ziepe.ca> <20200904133907.GS24045@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: E5B8C18140B60 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Sep 04, 2020 at 02:18:37PM +0000, Mircea CIRJALIU - MELIU wrote: > > This seems really sketchy, get_user_pages is sensitive to the VMA, what > > happens when VMA flags are different/etc? > > A debugger shouldn't complain if a portion of the debuggee is read-only, > just overwrite the data. At this point the kernel API here is so incredibly limited you may as well use a memfd for passing the shared address space instead of trying to do and maintain this complexity. Your use case is only qemu, so what is the problem to replace the allocator backing VM memory in userspace? Other people have been talking about doing a memfd already for different reasons - and memfd can already be shared as this scheme desires. Jason