Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2439348imm; Thu, 7 Jun 2018 10:35:01 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKawZrQCy3dzoS3+fpzQNvRh7jw8TWUFBEUazZl0koUMKFCdzC0CWkCXsLGSy7pnXiAVthM X-Received: by 2002:a62:ac14:: with SMTP id v20-v6mr2589255pfe.126.1528392901557; Thu, 07 Jun 2018 10:35:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528392901; cv=none; d=google.com; s=arc-20160816; b=JcBXwhglaIg/19k+avmNA+nZjlH7L39pgzhasAt0L5mL96kQGQnmUc6gf8fcFnQ/nH iCjd2Menufae1E8BuX8Prx5VvkbHE6A4+00oCDEukXOG7hgmK3jlpsDdrjLAOq1n9vJA cdw2Bk0Bf/wgh1hEitBjKRgAtgwqyX808SXZ8wsArOYeqfmDl2otS2OPWciT1DNbeFRX l97Y8dkZVwysLBPYTEro7KpzCXXTM39h9i7CZUHjwdQBJ/pohGOKmZU1KLSn5Rw6fwhf Kq6wmo6p4D8tHbJTUMUmxvdD1AF3d1red91PB1Lgaok2cnG2XOQkkBxQCDXrHVjgZKn4 KjEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=9LjRuBmrOG8NVhMIZLY2on+Lp1GAnXvb2u+4BtrL5MA=; b=P/WWRwZOjPztc7doCv4JGf/vGJYtXuOmydyOL7LKbHLu5Z0NXv371EG+xckH5dgJiy IDpUxAkHv7Chgb0ZI+3iemDyW1o2JXezZ/4GUffHOgoU8ctk7PTalPJykKySuFf/imzG 3+B6Avw9lXXYWdCsAuYnHEdiR7ooiSBU/zpp3rlUbgdebuS9xZJz++3myCqzDwOUl0lS XRD0n419qh5OjhtQ9tAeVxnZdKLc2MeKN39i9pwkeGPnh2GSSqZXdoi8ZbCu3XUksbMa 9hhzqpPZtzY4pK3gPkA+claLlCeo0Zd2ibnTg/bpYvjq9ODTyoShUV89hH6GXHnPoDV7 QoGA== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x1-v6si12755025pgb.635.2018.06.07.10.34.46; Thu, 07 Jun 2018 10:35:01 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934251AbeFGOkg (ORCPT + 99 others); Thu, 7 Jun 2018 10:40:36 -0400 Received: from mga09.intel.com ([134.134.136.24]:36280 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932912AbeFGOkc (ORCPT ); Thu, 7 Jun 2018 10:40:32 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Jun 2018 07:40:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,486,1520924400"; d="scan'208";a="47542281" Received: from 2b52.sc.intel.com ([143.183.136.51]) by orsmga008.jf.intel.com with ESMTP; 07 Jun 2018 07:40:31 -0700 From: Yu-cheng Yu To: linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, x86@kernel.org, "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , "H.J. Lu" , Vedvyas Shanbhogue , "Ravi V. Shankar" , Dave Hansen , Andy Lutomirski , Jonathan Corbet , Oleg Nesterov , Arnd Bergmann , Mike Kravetz Cc: Yu-cheng Yu Subject: [PATCH 0/9] Control Flow Enforcement - Part (2) Date: Thu, 7 Jun 2018 07:36:56 -0700 Message-Id: <20180607143705.3531-1-yu-cheng.yu@intel.com> X-Mailer: git-send-email 2.15.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Summary of changes: Shadow stack kernel config option; Control protection exception; and Shadow stack memory management. The shadow stack PTE needs to be read-only and dirty. Changes are made to: Use the read-only and hardware dirty combination exclusively for shadow stack; Use a PTE spare bit to indicate other PTE dirty conditions; Shadow stack page fault handling. Yu-cheng Yu (9): x86/cet: Control protection exception handler x86/cet: Add Kconfig option for user-mode shadow stack mm: Introduce VM_SHSTK for shadow stack memory x86/mm: Change _PAGE_DIRTY to _PAGE_DIRTY_HW x86/mm: Introduce _PAGE_DIRTY_SW x86/mm: Introduce ptep_set_wrprotect_flush and related functions x86/mm: Shadow stack page fault error checking x86/cet: Handle shadow stack page fault x86/cet: Handle THP/HugeTLB shadow stack page copying arch/x86/Kconfig | 24 ++++++ arch/x86/entry/entry_32.S | 5 ++ arch/x86/entry/entry_64.S | 2 +- arch/x86/include/asm/pgtable.h | 149 ++++++++++++++++++++++++++++++----- arch/x86/include/asm/pgtable_types.h | 31 +++++--- arch/x86/include/asm/traps.h | 5 ++ arch/x86/kernel/idt.c | 1 + arch/x86/kernel/relocate_kernel_64.S | 2 +- arch/x86/kernel/traps.c | 61 ++++++++++++++ arch/x86/kvm/vmx.c | 2 +- arch/x86/mm/fault.c | 11 +++ include/asm-generic/pgtable.h | 38 +++++++++ include/linux/mm.h | 8 ++ mm/huge_memory.c | 10 ++- mm/hugetlb.c | 2 +- mm/internal.h | 8 ++ mm/memory.c | 32 +++++++- 17 files changed, 353 insertions(+), 38 deletions(-) -- 2.15.1