Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1448237ybt; Thu, 2 Jul 2020 05:53:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpgmOCWK8AzzxxtAYFHTTl/F4aNc126oB6LZlEMuOCpXF3sKcjE7IFkZB0P3P5PSIj3eDP X-Received: by 2002:a50:bec2:: with SMTP id e2mr36181526edk.3.1593694396114; Thu, 02 Jul 2020 05:53:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593694396; cv=none; d=google.com; s=arc-20160816; b=Rr8tyx2FbwZ0HZugI+DzZnO2lre0ZlcfxeS8Uy8HDmTQbphSfacZUbK0oXNu0As0QD gjhyAvnyJpaFv1HLpOfvW2yolzzuKI/T4RTL2D9JSHeNsH6YVySZxFmd2CHPTNBTSGJT JQCKIX7yyrON+9PeUBD2ao5wFog2e+qVtHbj7pysiCVEpBKfDmbXqGZY+warh3e5xKXD l//GIycS6+GuUlXwnHcyKecrvChFwCBqfnOClA/0fJbXjCU3EE766qYZUEc79+WtYMfu aGRCxPxraAAD6m0ufP9m8jtzHNgJh3ytZ21R9abwTVFSsDFEkzv0M3QlBQkdnACT6+wU 2zOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=aqrdi9rxf7Tn9B3k1NE3iOQPIUnUUC4buFv5kHY3mUo=; b=EkG5OlkH4P37tSGF+NpQ5K52u5z6ESOyqkcqjK1Ve1iAs3s8cVejnt0KCCGsHgHt/3 yZY+6aLtFQC7Saa+jUW5Vf2Dx4pPxte4VdQzL/gZacGEltRQOud8HjQxX8XZI7Q1djN7 5vtoLJmSGoemCRT4hO01OrMRe3M5WR0frqf+wOLaAvzDpoO08mOYL6y+0jQMusfmfRrL 27dU32V+PkXQkw23QxyMcT01jYD+Ws/5+oopGtxQrjBjmmO19VwnNU6HzAwn0R6EmxMl 6alzbszLkA1VzN4leSuKJAIlbPYKcbY2rcIgBHmr0AmU7hGTe4M0O6huRrerTkiGVSUe G48g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=s+wavn4H; dkim=neutral (no key) header.i=@vger.kernel.org; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v10si5700106edy.595.2020.07.02.05.52.53; Thu, 02 Jul 2020 05:53:16 -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=pass header.i=@linutronix.de header.s=2020 header.b=s+wavn4H; dkim=neutral (no key) header.i=@vger.kernel.org; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729049AbgGBMw3 (ORCPT + 99 others); Thu, 2 Jul 2020 08:52:29 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:49372 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729017AbgGBMw2 (ORCPT ); Thu, 2 Jul 2020 08:52:28 -0400 X-Greylist: delayed 3188 seconds by postgrey-1.27 at vger.kernel.org; Thu, 02 Jul 2020 08:52:27 EDT From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1593694345; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=aqrdi9rxf7Tn9B3k1NE3iOQPIUnUUC4buFv5kHY3mUo=; b=s+wavn4HSYxSxIKkuL4eIm/PtK8lTqB36eaX2y2TcQ/I2sdoweM/Fgs7pq00wS68Gr4dKt vIObSw109eqvYfuRhM7+eC9orZVwFAXkk5GZlnhQHD5RwMA398CclKT3zd5m1miHCsxc6L qCJpErW3uIB6bPkzIkvwBOOut62fDufhmslWoqKUl2Sul918wrhPBF+xQNmTwdNxa3NkUR 35jErUo1ta+UPNp3v/C+tIzuemUMP/0dILY//Xn7eRDwViPg7ThmMNhRoCCM9XRCTa7pxT dqq6uZ37+PoWnmmTvYNNsH7iI0m4E/18gUONRABZv9Pzmqh9G4mr27sjoD5bhQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1593694345; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=aqrdi9rxf7Tn9B3k1NE3iOQPIUnUUC4buFv5kHY3mUo=; b=1g++i5NNy0K1Zec8OFkf4LBvyBFbhBa5uw9a9g7cIhIkrQojiaUhXljvXDUVxLoaUeN59+ VcEMEq3zNtSAAPCQ== To: Andy Lutomirski , Borislav Petkov Cc: Sean Christopherson , Jarkko Sakkinen , X86 ML , linux-sgx@vger.kernel.org, LKML , Jethro Beekman , Andrew Morton , Andy Shevchenko , asapek@google.com, "Xing\, Cedric" , chenalexchen@google.com, conradparker@google.com, cyhanish@google.com, Dave Hansen , "Huang\, Haitao" , Josh Triplett , "Huang\, Kai" , "Svahn\, Kai" , kmoy@google.com, Christian Ludloff , Andrew Lutomirski , Neil Horman , npmccallum@redhat.com, puiterwijk@redhat.com, David Rientjes , yaozhangx@google.com Subject: Re: [PATCH v33 15/21] x86/vdso: Add support for exception fixup in vDSO functions In-Reply-To: References: <20200617220844.57423-1-jarkko.sakkinen@linux.intel.com> <20200617220844.57423-16-jarkko.sakkinen@linux.intel.com> <20200629171022.GC32176@zn.tnic> <20200630060055.GS12312@linux.intel.com> <20200630084128.GA1093@zn.tnic> Date: Thu, 02 Jul 2020 14:52:25 +0200 Message-ID: <87mu4i9j06.fsf@nanos.tec.linutronix.de> 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 Andy Lutomirski writes: > On Tue, Jun 30, 2020 at 1:41 AM Borislav Petkov wrote: >> >> On Mon, Jun 29, 2020 at 11:00:55PM -0700, Sean Christopherson wrote: >> > E.g. the vDSO function should get the fixup even if userspace screws >> > up mmap() and invokes __vdso_sgx_enter_enclave() without being tagged >> > an SGX task. >> >> I sincerely hope you don't mean this seriously. >> >> Please add a member to task_struct which denotes that a task is an >> sgx task, test that member where needed and forget real quickly about >> running *any* *fixup* for unrelated tasks. > > I don't see the problem. If you call this magic vDSO function and get > a fault, it gets handled. What's the failure mode? Handled by some definition of handled. If a random user space tasks ends up in that function then it will not die as it would otherwise, but I don't see a real issue with that either. Thanks, tglx