From patchwork Mon Nov 19 21:49:23 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: 10689567 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 424496C5 for ; Mon, 19 Nov 2018 21:55:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 35E9E2A583 for ; Mon, 19 Nov 2018 21:55:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 296822A6EE; Mon, 19 Nov 2018 21:55:33 +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 B49342A583 for ; Mon, 19 Nov 2018 21:55:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1ECA66B1CAF; Mon, 19 Nov 2018 16:54:55 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 14D066B1CB0; Mon, 19 Nov 2018 16:54:55 -0500 (EST) 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 F07736B1CB1; Mon, 19 Nov 2018 16:54:54 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by kanga.kvack.org (Postfix) with ESMTP id A5A196B1CAF for ; Mon, 19 Nov 2018 16:54:54 -0500 (EST) Received: by mail-pl1-f199.google.com with SMTP id t22so642285plo.10 for ; Mon, 19 Nov 2018 13:54:54 -0800 (PST) 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=xZ65RXA3i9fVJNnQqtv16rTph4JyecQhqmSW7fPui10=; b=iA1m+r8ltGbrke4v2oMCGEjN9WRLsuOjdeLBeXHJ+AzRYu97Gt9vAE3GQOsLn3PEJ0 K9W+8Pl4ylpHENv3C7F3/aLs/6HK8Y9TTfUHSVDT+JG4iOvwulvvDEaUPdnbaSwocfIF LkT21BnezV7HA640QJTiovU0vfffnomjuJelXQyk5okvVxvRNMh3srvU6KstcEq0AZCK leYElGsSrltSh7Lupg0UE8POgK/hHrJ9WUMfFqZ4P9yiDvOpHhB/tNuVfu+EQTziagVG 42Sni/xJHd6Lqhm+QkTGRp92XSuzZYDP5kIAE28DUE3DRCMRGQVXjXp6SvI8ARca8+by 2Lrg== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of yu-cheng.yu@intel.com designates 192.55.52.93 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: AGRZ1gLMWEjeFtjm+IoH4yoOKW2W8HBSybIqDRr2PElHkHnAjPkXVWIA ZLRIkTLNa2ssCxgOBw5r2IKT3ps5PFJ159pgAWYYtAuMi11aBGbNCtL6VYiq9yO+YFwHOWaMHQS siiFjUYCSftMcYvcY4dlNIFwAmrdx6el42YUPqy9s6KvbBzVazfdQD//L8AuD8xTEyg== X-Received: by 2002:a17:902:6a8b:: with SMTP id n11-v6mr24534903plk.311.1542664494303; Mon, 19 Nov 2018 13:54:54 -0800 (PST) X-Google-Smtp-Source: AJdET5dP0r+11bvrt5/NfrGeLUl39IQU0e4eCJmDg6ix/IHuTk9ggRPl0vdBo6vpPwQtGNUkwUvM X-Received: by 2002:a17:902:6a8b:: with SMTP id n11-v6mr24534872plk.311.1542664493616; Mon, 19 Nov 2018 13:54:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542664493; cv=none; d=google.com; s=arc-20160816; b=I75V36InIs5AWv4LacosiS/VJ/8g+JgdfQHgsg+8A28nghEbBLEjhlfp0QCBM5zRU3 wWyO4v7Lea5xp6h/EaGZfwyLZrLDw560pKJxZS1g0XnOrkeSAwSnFWZL7fa9mc+x5CyR DcLGstMnOkujabAmfrDi2pQj2D7xvr5/zoo+YZyCwDz1HJ3nVHeHhTUzOV5Uk3ePdVOi +RC7Vx21UAgI0HLPz8vvIIycA1idydghj0/O2OUnBPcp2PTYic7F3Dg3YIltI1uurjGk 78axMb6Kna5f1+m2IcObf7dDZf+mFc12RMZ7+Tb8fZHtWDnsqBRsWWQvt/gkjgyLrj5o 6M6Q== 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; bh=xZ65RXA3i9fVJNnQqtv16rTph4JyecQhqmSW7fPui10=; b=Y/QZ9PqcFk93j533JmKYxCty0xuvj1Zl5yA6pz1fVXJo7+EBpotRHSoSARnTAGwltb OVROtDeQBzYM8jXwyH54sutqfZR68C9f6FZ891rAiLifKGECovdDfxU6e70V+4G5SgCL 1Sa3sjbU5bq0A85p+znQ2qVWfUDv4SuxcfbS5KMM69aVekZOdEBLyv6zzqEjZINtI5vY PI6H+CGn1PEAryo0rhZyAF3RWdaHQeboHa1xO3IeXJ3EoBli4WpQlDqSfZXAPGmcB2QT h3iO9GZ/VSIx6bOtnbjlyy76XIM1Jalh/6zkikyxrhiOYCqb0eSMdbq8N/hhFdauhDfp I4ZA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of yu-cheng.yu@intel.com designates 192.55.52.93 as permitted sender) smtp.mailfrom=yu-cheng.yu@intel.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from mga11.intel.com (mga11.intel.com. [192.55.52.93]) by mx.google.com with ESMTPS id s8si4586261plq.345.2018.11.19.13.54.53 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Nov 2018 13:54:53 -0800 (PST) Received-SPF: pass (google.com: domain of yu-cheng.yu@intel.com designates 192.55.52.93 as permitted sender) client-ip=192.55.52.93; Authentication-Results: mx.google.com; spf=pass (google.com: domain of yu-cheng.yu@intel.com designates 192.55.52.93 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 orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Nov 2018 13:54:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,254,1539673200"; d="scan'208";a="92423875" Received: from yyu32-desk1.sc.intel.com ([143.183.136.147]) by orsmga006.jf.intel.com with ESMTP; 19 Nov 2018 13:54:51 -0800 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 , Eugene Syromiatnikov , Florian Weimer , "H.J. Lu" , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Peter Zijlstra , Randy Dunlap , "Ravi V. Shankar" , Vedvyas Shanbhogue Cc: Yu-cheng Yu Subject: [RFC PATCH v6 00/11] Control-flow Enforcement: Branch Tracking, PTRACE Date: Mon, 19 Nov 2018 13:49:23 -0800 Message-Id: <20181119214934.6174-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 The previous version of CET Branch Tracking/PTRACE patches is at the following link: https://lkml.org/lkml/2018/10/11/662 Summary of changes from v5: Remove the legacy code bitmap allocation from kernel. Now GLIBC allocates the bitmap and passes it to the kernel. Some small fixes. H.J. Lu (3): x86: Insert endbr32/endbr64 to vDSO x86/vsyscall/32: Add ENDBR32 to vsyscall entry point x86/vsyscall/64: Add ENDBR64 to vsyscall entry points Yu-cheng Yu (8): x86/cet/ibt: Add Kconfig option for user-mode Indirect Branch Tracking x86/cet/ibt: User-mode indirect branch tracking support x86/cet/ibt: Add IBT legacy code bitmap setup function mm/mmap: Add IBT bitmap size to address space limit check 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 x86/cet: Add PTRACE interface for CET arch/x86/Kconfig | 16 ++++++ 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/entry/vdso/vdso32/system_call.S | 3 ++ arch/x86/entry/vsyscall/vsyscall_emu_64.S | 9 ++++ 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/asm/mmu_context.h | 10 ++++ arch/x86/include/uapi/asm/elf_property.h | 1 + arch/x86/include/uapi/asm/prctl.h | 2 + arch/x86/kernel/cet.c | 54 +++++++++++++++++++ arch/x86/kernel/cet_prctl.c | 21 ++++++++ arch/x86/kernel/cpu/common.c | 17 ++++++ arch/x86/kernel/elf.c | 5 ++ arch/x86/kernel/fpu/regset.c | 41 ++++++++++++++ arch/x86/kernel/process.c | 1 + arch/x86/kernel/ptrace.c | 16 ++++++ arch/x86/lib/x86-opcode-map.txt | 13 ++++- include/uapi/linux/elf.h | 1 + mm/mmap.c | 19 ++++++- .../arch/x86/include/asm/disabled-features.h | 8 ++- tools/objtool/arch/x86/lib/x86-opcode-map.txt | 13 ++++- 25 files changed, 286 insertions(+), 11 deletions(-)