Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp656607ybg; Mon, 1 Jun 2020 10:56:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy9eHmciMYYtuI/RA5YItN5QpkDsBhxYK9w0OgLxr+wRO9XCD/gOg/dTfNrgQuAFF1QboZm X-Received: by 2002:a05:6402:1812:: with SMTP id g18mr3790052edy.96.1591034189068; Mon, 01 Jun 2020 10:56:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591034189; cv=none; d=google.com; s=arc-20160816; b=cnVRssLF3WHBsJQC5OHPiIFAFztNt/Q6IOvkRYyhddKXhguyMqQ8chTFs1Wucm1QwS mN+B6kooi3eswkkDZkHRiFsqsjSWmCDuE8JRlfM8AtUSISXzmwJi7OLE9NJI5Fxv+8M9 NT67ZOqlAOFE8D111YQP7adHbGvbKqxqQA1BjqBraQmmFMGrZCqIMi2Jr/wfR/NISfaK aydcsb/BM5bi7m7fQ2InPnp2EucI4eEzsdYsLL/Q1IWTu3QmdNTa9kwHUZnogMbuhknJ xTPW8HWE2UF1FXOYJZ9W1NnPxAk44qGzoYi+YFeHfW+2bkz/RFdTRC52VLXHsdrObnAG Yu7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:organization:subject:cc:to:from; bh=yqNglOBFx6U4+NtVK2U0e+/RuRTDP2RxXQpnqa0ifAg=; b=KJKNDhBn4oc6O7BpwLqBj+3JOCVUvuOucOUCN5hD85upv2GxcctmNHvYN1iNlpjhdB taJw4oyqoitbeje+75hP2dkynAwqofTnQZNbd1g8M4TBf48sALugYta/LTIhGWXC+YKL Gm08Rs5t0RDC2lSmjtj5Vq1ZK5Jjylz3tScNy6jP38XKb8ytmFnSOQJnpX9ODu2iRSFV UpEx8HliRV+JcuR5aKDixSMuseN1hR8gXnEtTOOR6erqefKocBXZvAS2PBhmY1as+WRN RLUccDBhZxv4LgYuj17gVwTSjiwrxsAYqd9F+ggiexrNU3mQL8T9q7YhI0cEiaNTEOF1 6obQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x5si125936eju.145.2020.06.01.10.56.05; Mon, 01 Jun 2020 10:56:29 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728077AbgFARxR (ORCPT + 99 others); Mon, 1 Jun 2020 13:53:17 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:41466 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726113AbgFARxR (ORCPT ); Mon, 1 Jun 2020 13:53:17 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: krisman) with ESMTPSA id 7A1252A2519 From: Gabriel Krisman Bertazi To: Matthew Wilcox Cc: Paul Gofman , 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 Organization: Collabora References: <20200530055953.817666-1-krisman@collabora.com> <202005300923.B245392C@keescook> <851rn0ejg9.fsf@collabora.com> <9a512096-7707-3fc6-34ba-22f969c0f964@gmail.com> <20200531164938.GF19604@bombadil.infradead.org> Date: Mon, 01 Jun 2020 13:53:11 -0400 In-Reply-To: <20200531164938.GF19604@bombadil.infradead.org> (Matthew Wilcox's message of "Sun, 31 May 2020 09:49:38 -0700") Message-ID: <857dwq7jw8.fsf@collabora.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Matthew Wilcox writes: > 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 Hi Matthew, I don't oppose your suggestion, as Paul said, it should be enough for us. But could you elaborate on the problems you see in the original approach, even if only for my own education? > 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. > -- Gabriel Krisman Bertazi