Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp2140298ybm; Sun, 31 May 2020 09:53:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/SYIrkRJ1B7JGEJTRqWBbc4C9BtBuusoRwZv9W8uYVw6DU4+GtN8sBChqRm1372wTNcUg X-Received: by 2002:a17:907:4240:: with SMTP id oi24mr1657613ejb.127.1590943986647; Sun, 31 May 2020 09:53:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590943986; cv=none; d=google.com; s=arc-20160816; b=BghXKd1yxBejuw6kQHR9/ZN0UJ0/6H6JEFl1W8N6grXy3jEhSZKjY8HahmYINTVOmT mnhhXUqa1Cj0kYI+f9B7IFejDy5++NfZOswiUJURCQEW6Pxg1CHuRAbs4HURSFzmJjce XxZGMoSjT+wCVnLRLcHoa1StvkZ1t/RH90VqA//J16MDEPbzdulHDuGfmNsC/RNee9gV 7wa3pssRKsVXBPSKe1UfNZjVf0v7QLvoCtABgY/XLtKmDW4IR1YYSdhdhe+e5BxXWrK2 xK75UmlWwC0YmebzE6w8i2QRGTXEPmiqknBGRv/j2hyORM0EIeYwn24AMyEYrMqeUJEv zDag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=zHI8YcI5KuBim4k22BPcPxAPjXUnIAezF8YZZy2PJq0=; b=cCunmaN4El/cJ6iyfGkfW+ZukX+oVQmlFoaxdULl1Qbs53kAPC5XM/qv6J9gddANb+ V/dx9Hb7B67XXhYCBsJssY+u/BqsbSpo9ckrUOAlO4LGhUvInSRVv1UO6wE9JK9ktlrW 03ROImtToBQt9u8TZnV7rrOfWDgpd7Ig0df5ViJwOUb3rZV+44TJ1516zE0vZDLYI9pU JWayR7BbqeeprdSrB2PwksyOn9SC6TRl0Y7BoZ/Ucrslu9R+8gxA4Flk9y4PpDX1GeSc PtfJWgr2irMUbpr/h8ej44ZHFWCYKk87tNLtJaZuYjaQK1V7AMCEDe6ric9/BUCtV2xL lbLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Eavx3EOb; 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 e21si9533375ejh.710.2020.05.31.09.52.41; Sun, 31 May 2020 09:53:06 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Eavx3EOb; 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 S1728209AbgEaQtr (ORCPT + 99 others); Sun, 31 May 2020 12:49:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725912AbgEaQtq (ORCPT ); Sun, 31 May 2020 12:49:46 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B3C3C061A0E; Sun, 31 May 2020 09:49:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=zHI8YcI5KuBim4k22BPcPxAPjXUnIAezF8YZZy2PJq0=; b=Eavx3EObjthDo3toch0NT8OIoy QI9zoKzoDzyBHmP4/jCwVL2nb7pLPV5kO2hqmhiGeGWekVqEWX/KRL/dFJgCXyptxZDk24eHF0Uw0 tpOS98Gl8uy64T8aUAwiPoAPhFiNdcWc19hOPco1TNGG0b2BijsFaZYwmsJ1I6svpSYc4P+I7Ng8U 1Kbx60T6aWt3XOz04iWot+4a2rrjbkuQ7qmPos7xZ8CKhVTB7XfOWY8r9S56ojHO3T0rJAWOg1W+0 jC/O7TIPSrvdSwKMkZ48CXsttpRe3cHKNaiudKs9A4X6hsbhMg4oXDxS/BwOwqdbYrP0eLgC681Lw 6WNPaDKg==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jfR9W-0007y1-QP; Sun, 31 May 2020 16:49:38 +0000 Date: Sun, 31 May 2020 09:49:38 -0700 From: Matthew Wilcox To: Paul Gofman Cc: Gabriel Krisman Bertazi , Kees Cook , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel@collabora.com, Thomas Gleixner , Andy Lutomirski , Will Drewry , "H . Peter Anvin" , linux-security-module@vger.kernel.org, Zebediah Figura Subject: Re: [PATCH RFC] seccomp: Implement syscall isolation based on memory areas Message-ID: <20200531164938.GF19604@bombadil.infradead.org> References: <20200530055953.817666-1-krisman@collabora.com> <202005300923.B245392C@keescook> <851rn0ejg9.fsf@collabora.com> <9a512096-7707-3fc6-34ba-22f969c0f964@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9a512096-7707-3fc6-34ba-22f969c0f964@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, May 31, 2020 at 03:39:33PM +0300, Paul Gofman wrote: > > Paul (cc'ed) is the wine expert, but my understanding is that memory > > allocation and initial program load of the emulated binary will go > > through wine. It does the allocation and mark the vma accordingly > > before returning the allocated range to the windows application. > Yes, exactly. Pretty much any memory allocation which Wine does needs > syscalls (if those are ever encountered later during executing code from > those areas) to be trapped by Wine and passed to Wine's implementation > of the corresponding Windows API function. Linux native libraries > loading and memory allocations performed by them go outside of Wine control. I don't like Gabriel's approach very much. Could we do something like issue a syscall before executing a Windows region and then issue another syscall when exiting? If so, we could switch the syscall entry point (ie change MSR_LSTAR). I'm thinking something like a personality() syscall. But maybe that would be too high an overhead.