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=-0.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, 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 512AAC433DF for ; Sun, 31 May 2020 16:49:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DCDAA2074B for ; Sun, 31 May 2020 16:49:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="Eavx3EOb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DCDAA2074B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3D01D80007; Sun, 31 May 2020 12:49:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3596A8E0003; Sun, 31 May 2020 12:49:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2220F80007; Sun, 31 May 2020 12:49:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0084.hostedemail.com [216.40.44.84]) by kanga.kvack.org (Postfix) with ESMTP id 07B688E0003 for ; Sun, 31 May 2020 12:49:47 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id B6636249A for ; Sun, 31 May 2020 16:49:46 +0000 (UTC) X-FDA: 76877600772.30.unit47_723b765004d29 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin30.hostedemail.com (Postfix) with ESMTP id 9F93B180B3C85 for ; Sun, 31 May 2020 16:49:46 +0000 (UTC) X-HE-Tag: unit47_723b765004d29 X-Filterd-Recvd-Size: 3102 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf40.hostedemail.com (Postfix) with ESMTP for ; Sun, 31 May 2020 16:49:44 +0000 (UTC) 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> X-Rspamd-Queue-Id: 9F93B180B3C85 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 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.