Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2375860yba; Sat, 27 Apr 2019 22:49:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqzEpTrTIx136onZyGTRXQ3UGQTT6xBUTjAXTekSC2y/G6Zk4qICX3lrjmbOR/VqZpYwZfaH X-Received: by 2002:a63:1055:: with SMTP id 21mr33476124pgq.200.1556430546416; Sat, 27 Apr 2019 22:49:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556430546; cv=none; d=google.com; s=arc-20160816; b=iwdsuqtbw1n9kXdEXoaKF9IPnK8yEzZ8QWSNgNH2BtoICKFKYE2stCbg34sS8uIIuI eG8Ucupswb9ELpIBp+i2b+5WNkayQkC2bWRUzFRk/jKNLAF+36OgJEFxTgsvebUsMSe7 UvQn0t/opT9On9lY3SDrU8Xh/0uRvRdx0v5AVuWGn2giKEnhQOxK3zFf2TJ3ZSbAbdiw 0YbQ2i1qEu6x5EHPq9cKGyfcytTDMq6rIOkOSFqs2WMw+J2Cu/3a8pQDewgN3ad4Y9mT S0fbHf+LehcVmivW9K9zbUY8+lJtl0xOejbLL6mOI5XqY3ULjYqtxQxOtvwuYpCCMTCx 2SXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:subject:cc:to:from:date; bh=cFoXT26Ut5J38gNbrWm0ZX2oaBdIiGTgJzTQo+EfHms=; b=gFtcWLXedurBowH/Az7XkMTgrlrLVD8qBaqjY8VnKOwMwmGtlylL5X3s49d3wF1ZMI A88F0YD31VKTiu4NN2oGbMPB/elL/QaynKV2PH+Zn1Cxsdy6WSqVsWOaVdH3WM+Zve1J KtlF04R2Qrho1g0xW0W9kdwguAwFgw2/Ll8A2HqQPMaZ65cPZ5uKGYa4up2qAAd4Z8yt 8TFaSP3t1/Drr/CXMKr9eiy4fA8h+ZLPfNDH2XKbjFutFz2X/AtIg7ZgBxOXtkDqMoL0 k0VbpG/KRx8hWXVgYBlGAC3XXWlGlKtFfl5Pes8ysQ97ev9bjyVjppIlEHfxpWeji9Ty +wCg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m15si29301249pgj.126.2019.04.27.22.48.51; Sat, 27 Apr 2019 22:49:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726377AbfD1FrZ (ORCPT + 99 others); Sun, 28 Apr 2019 01:47:25 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:37974 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725999AbfD1FrY (ORCPT ); Sun, 28 Apr 2019 01:47:24 -0400 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x3S5dTZm055899 for ; Sun, 28 Apr 2019 01:47:23 -0400 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 2s54kvt747-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sun, 28 Apr 2019 01:47:23 -0400 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 28 Apr 2019 06:47:20 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp03.uk.ibm.com (192.168.101.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Sun, 28 Apr 2019 06:47:15 +0100 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x3S5lE3355115962 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 28 Apr 2019 05:47:14 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A6EF311C04C; Sun, 28 Apr 2019 05:47:14 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7CB1D11C04A; Sun, 28 Apr 2019 05:47:13 +0000 (GMT) Received: from rapoport-lnx (unknown [9.148.8.112]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Sun, 28 Apr 2019 05:47:13 +0000 (GMT) Date: Sun, 28 Apr 2019 08:47:11 +0300 From: Mike Rapoport To: Peter Zijlstra Cc: linux-kernel@vger.kernel.org, Alexandre Chartre , Andy Lutomirski , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Ingo Molnar , James Bottomley , Jonathan Adams , Kees Cook , Paul Turner , Thomas Gleixner , linux-mm@kvack.org, linux-security-module@vger.kernel.org, x86@kernel.org Subject: Re: [RFC PATCH 5/7] x86/mm/fault: hook up SCI verification References: <1556228754-12996-1-git-send-email-rppt@linux.ibm.com> <1556228754-12996-6-git-send-email-rppt@linux.ibm.com> <20190426074223.GY4038@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190426074223.GY4038@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.5.24 (2015-08-30) X-TM-AS-GCONF: 00 x-cbid: 19042805-0012-0000-0000-000003160447 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19042805-0013-0000-0000-0000214E65F8 Message-Id: <20190428054711.GD14896@rapoport-lnx> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-04-28_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=417 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904280040 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 26, 2019 at 09:42:23AM +0200, Peter Zijlstra wrote: > On Fri, Apr 26, 2019 at 12:45:52AM +0300, Mike Rapoport wrote: > > If a system call runs in isolated context, it's accesses to kernel code and > > data will be verified by SCI susbsytem. > > > > Signed-off-by: Mike Rapoport > > --- > > arch/x86/mm/fault.c | 28 ++++++++++++++++++++++++++++ > > 1 file changed, 28 insertions(+) > > There's a distinct lack of touching do_double_fault(). It appears to me > that you'll instantly trigger #DF when you #PF, because the #PF handler > itself will not be able to run. The #PF handler is able to run. On interrupt/error entry the cr3 is switched to the full kernel page tables, pretty much like PTI does for user <-> kernel transitions. It's in the patch 3. > And then obviously you have to be very careful to make sure #DF can, > _at_all_times_ run, otherwise you'll tripple-fault and we all know what > that does. > -- Sincerely yours, Mike.