From patchwork Thu Aug 30 14:40:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu-cheng Yu X-Patchwork-Id: 10581875 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 31CE75A4 for ; Thu, 30 Aug 2018 14:45:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 220392B560 for ; Thu, 30 Aug 2018 14:45:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1316E2BC83; Thu, 30 Aug 2018 14:45:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A4AC72B560 for ; Thu, 30 Aug 2018 14:45:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B545B6B523F; Thu, 30 Aug 2018 10:44:44 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id B04766B5241; Thu, 30 Aug 2018 10:44:44 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 956FF6B5240; Thu, 30 Aug 2018 10:44:44 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by kanga.kvack.org (Postfix) with ESMTP id 469DF6B523E for ; Thu, 30 Aug 2018 10:44:44 -0400 (EDT) Received: by mail-pl1-f198.google.com with SMTP id g92-v6so1005224plg.6 for ; Thu, 30 Aug 2018 07:44:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id; bh=lSC49C18HhJxmyWt53nXMU0xNuZ5b1tYXqwFIInkqLo=; b=bsERqZKodE0PgRiSIWfH7wP3fnm1pG9EKi6dvjWkjWwkBdmEYm79hq6bUtfSS6gROt D/d7t8feA8X4/mbSrIOZh6UIRoZS9phZkUJyDIyPZtYmupC+hnVJx8jE2/KsVhbCLLEM apsJRkj9pNDt3r3ZH5ICfCsrSGRMlKeAzzMukuTniHq1jw0RjctEzBii0T2J6dQO+Zx7 tUQ+GKvFfqpr6ZNKW0O5mRpSF495Xmk9mY3VYGN5WXDt6n7QPKTnmv7gyI/cZNdtAoG7 Kv0zm+zQV8mBlPR+3xc8hNetdOhzzjzlkaKYQyABfy/6XzOP1yAUK4b7lTR4G0b2ZFBL QOtA== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of yu-cheng.yu@intel.com designates 134.134.136.126 as permitted sender) smtp.mailfrom=yu-cheng.yu@intel.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Gm-Message-State: APzg51DXiRuvCoDUVO5GB9KY2o7UCy3G9/xcVbBJpVywT3Qj0JvIqv1L 69vIHzrl1Gx4+LPkrx3ABafpXjYs4bJMAwsj1rDzS+wOmYlgE690GIhJDecnXob6B8d4pia7GEM HA5i4kq72+myVd84EpMxR5QeijqSNMalGyo9xl0uLSackZFOEP+9vKMf/3pryLHerYg== X-Received: by 2002:a17:902:4401:: with SMTP id k1-v6mr10201557pld.97.1535640283970; Thu, 30 Aug 2018 07:44:43 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZkDZ0vuN1YkBbqJeUC25DkxwujzwHYgfnbu5SEaA2yc2ZDw0y4KoXfWTX4J2D9S5SQFZA+ X-Received: by 2002:a17:902:4401:: with SMTP id k1-v6mr10201520pld.97.1535640283248; Thu, 30 Aug 2018 07:44:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535640283; cv=none; d=google.com; s=arc-20160816; b=AseO/FTKbraVn4IU4Q27mem7PQCNeXL1/3JdP/gpOAGwTcjXVqzlinpc6nwWmsOM8y 0olfezgxkM5TkcDL1nKUKZZt5IBiXRLQ+J3OyEIYGlUEW29Qs1BqJpTAdARHUcjc/dfO TQYwSpEk078kfIFtSxamOJYs+zjjLQaR5039rtXtTtMR3NNpIBbdeJ5oa1EipA2H6hiH gyGDIszH+FPZiJ3oZatycXjYINnm463gTAMjwzSTO5KNIRRFoWaW/Ir57Am29sat+UTs WnO+NdfnHq7LM7SboBuI05neQbzG4s3bM8Yb9hizwuH4jUiIM0aRuwIDmXlbI2TDDAKV 174Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:arc-authentication-results; bh=lSC49C18HhJxmyWt53nXMU0xNuZ5b1tYXqwFIInkqLo=; b=QGf6jTZsCvoYdGN6gKY6EimSw4UO/E+c6DU3WxcQkVpsNyNVMKxE5SIdyl/MhI+ISb 0IXlVsOy3PxGPkfPHU321cRe85kquG0qVgQGlaKrXxH7GLVKi/DhfeJ8/08O2Q2ymOOV gw1IahiX4dZTaeMumYn6TRp73NLSDtk8uu3Y8zG7QacUwfO1yG+Eeb/HVPC8v7CpYywy FAFrpfOv0m0T9lne6uqmz9Mxae2D6DVOebnmEmWG9di480hqQAL0pHukuM0OOlflochQ cbKcm0zs+b6ziLBBeyV3o+vnFsIT5P6dMeWz/X+ZMFGdN3+lUYreXupj6k5SmZXho4wn ZeEQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of yu-cheng.yu@intel.com designates 134.134.136.126 as permitted sender) smtp.mailfrom=yu-cheng.yu@intel.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from mga18.intel.com (mga18.intel.com. [134.134.136.126]) by mx.google.com with ESMTPS id t10-v6si6980653pgn.667.2018.08.30.07.44.43 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 07:44:43 -0700 (PDT) Received-SPF: pass (google.com: domain of yu-cheng.yu@intel.com designates 134.134.136.126 as permitted sender) client-ip=134.134.136.126; Authentication-Results: mx.google.com; spf=pass (google.com: domain of yu-cheng.yu@intel.com designates 134.134.136.126 as permitted sender) smtp.mailfrom=yu-cheng.yu@intel.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Aug 2018 07:44:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,307,1531810800"; d="scan'208";a="228910330" Received: from 2b52.sc.intel.com ([143.183.136.52]) by orsmga004.jf.intel.com with ESMTP; 30 Aug 2018 07:44:29 -0700 From: Yu-cheng Yu To: x86@kernel.org, "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org, Arnd Bergmann , Andy Lutomirski , Balbir Singh , Cyrill Gorcunov , Dave Hansen , Florian Weimer , "H.J. Lu" , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Peter Zijlstra , "Ravi V. Shankar" , Vedvyas Shanbhogue Cc: Yu-cheng Yu Subject: [RFC PATCH v3 0/8] Control Flow Enforcement: Branch Tracking, PTRACE Date: Thu, 30 Aug 2018 07:40:01 -0700 Message-Id: <20180830144009.3314-1-yu-cheng.yu@intel.com> X-Mailer: git-send-email 2.17.1 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: X-Virus-Scanned: ClamAV using ClamSMTP This set includes CET Indirect Branch Tracking patches and a PTRACE patch. Summary of changes from v2: Allocate IBT bitmap at the start of a task. H.J. Lu (1): x86: Insert endbr32/endbr64 to vDSO Yu-cheng Yu (7): x86/cet/ibt: Add Kconfig option for user-mode Indirect Branch Tracking x86/cet/ibt: User-mode indirect branch tracking support x86/cet/ibt: ELF header parsing for IBT x86/cet/ibt: Add arch_prctl functions for IBT x86/cet/ibt: Add ENDBR to op-code-map mm/mmap: Add IBT bitmap size to address space limit check x86/cet: Add PTRACE interface for CET arch/x86/Kconfig | 12 +++ arch/x86/Makefile | 7 ++ arch/x86/entry/vdso/.gitignore | 4 + arch/x86/entry/vdso/Makefile | 12 ++- arch/x86/entry/vdso/vdso-layout.lds.S | 1 + arch/x86/include/asm/cet.h | 8 ++ arch/x86/include/asm/disabled-features.h | 8 +- arch/x86/include/asm/fpu/regset.h | 7 +- arch/x86/include/uapi/asm/elf_property.h | 1 + arch/x86/include/uapi/asm/prctl.h | 1 + arch/x86/include/uapi/asm/resource.h | 5 ++ arch/x86/kernel/cet.c | 74 +++++++++++++++++++ arch/x86/kernel/cet_prctl.c | 38 +++++++++- arch/x86/kernel/cpu/common.c | 20 ++++- arch/x86/kernel/elf.c | 8 +- arch/x86/kernel/fpu/regset.c | 41 ++++++++++ arch/x86/kernel/process.c | 2 + arch/x86/kernel/ptrace.c | 16 ++++ arch/x86/lib/x86-opcode-map.txt | 13 +++- include/uapi/asm-generic/resource.h | 3 + include/uapi/linux/elf.h | 1 + mm/mmap.c | 12 ++- tools/objtool/arch/x86/lib/x86-opcode-map.txt | 13 +++- 23 files changed, 294 insertions(+), 13 deletions(-)