Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1652709ybk; Thu, 21 May 2020 11:53:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAGGWojGIAqeslXGeT64bjpvWGH/DrZIp+ICXhH/nM2wYnCBTHi0WzzqH79kDEPybrzlKn X-Received: by 2002:a17:906:9157:: with SMTP id y23mr5178633ejw.0.1590087192629; Thu, 21 May 2020 11:53:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590087192; cv=none; d=google.com; s=arc-20160816; b=tE3oZe3z22HzuUNSCuu0VAIaRRaMsh12iCFTtl6EOGInZphRf6golpzdhcuBPZUymj ouEdfGoHYh8Mwb9WX9moOEQ6iqaFKQ/gA6ZNkAunagZSBJhRIE96UFQdUrlwnA1dvTcI rmiSg4P7vw33bunwk+d3hn4JUhcFHtfOaU5tgjSZQjNulnD4M5x+jmfO9DBtbe6m5CyB +k2CqYDGJ2OwuxwdZPEfas1Qgt+5gIcUobhr8yBkB1dNZasXM6+ncPWM8KJWDnaAekQB R1Y5p0bd5XHWbCU8Ju5IqBEktw/p1crKLV8Q+Gl+BULUbEauP7jCwoRQiwKK8USlMeXX APqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=Rs+m7lfqAN3pPyrPrrr6uOK5gesHtkkEPEmJgvQPL0I=; b=jmtLlFRH2jA/3YV0o50XBIZ5lBHNyY2E0rh2PZIvNOABTZV+zAnpOA8aUtp0Xr5447 bZyrkCbt3kazw1SxJFUs/F2cfQrpZtQmqZMi8EKUwCn9BHUS2LBC8jWqDLF0peIfph/M hWRbgde9hal983RIkqSl1YF/oU0yNiQEyYyuk4xzNVrrA91OX5esoF9SSMVO6vwzeee6 lFwNkBonGoxmMvJOakVmLyH19rrwGHZAzyj7uhgEqLW7kAYc1SYQnMnC/ctV5bxPxR9a wna8iizS/I17VfI58jEX/7svBp/J+aWF7vP2cy67hAHiApMI+p/KTxLa4AYqUMyfZ3JO jARg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OV+9nqBf; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id pk2si1177918ejb.363.2020.05.21.11.52.49; Thu, 21 May 2020 11:53:12 -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=@redhat.com header.s=mimecast20190719 header.b=OV+9nqBf; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729805AbgEUSux (ORCPT + 99 others); Thu, 21 May 2020 14:50:53 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:27875 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729151AbgEUSux (ORCPT ); Thu, 21 May 2020 14:50:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590087051; 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=Rs+m7lfqAN3pPyrPrrr6uOK5gesHtkkEPEmJgvQPL0I=; b=OV+9nqBfm2OhAOUhIvyoy5puLIcORnfVewey2fZOrwPb+kNK15iPEih5DT39XZQChC/lc6 6vsuM7bQyVxTmiFsQofDBg/0ZnsoyLl3DV7nSclF9r6bNWyypFsAHSQVflw/86bybkuYsq W9/9arjjfVzlUkiKzMUPfUcDobA2ie8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-234-pa3aOYhsPzKJFP-_NlnKEw-1; Thu, 21 May 2020 14:50:33 -0400 X-MC-Unique: pa3aOYhsPzKJFP-_NlnKEw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B8E9D805720; Thu, 21 May 2020 18:50:29 +0000 (UTC) Received: from treble (ovpn-112-59.rdu2.redhat.com [10.10.112.59]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C17A85C1B0; Thu, 21 May 2020 18:50:17 +0000 (UTC) Date: Thu, 21 May 2020 13:50:15 -0500 From: Josh Poimboeuf To: Yu-cheng Yu Cc: 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 , Borislav Petkov , 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 , Dave Martin , Weijiang Yang Subject: Re: [PATCH v10 00/26] Control-flow Enforcement: Shadow Stack Message-ID: <20200521185015.aopfkpwpfhzwd4hs@treble> References: <20200429220732.31602-1-yu-cheng.yu@intel.com> <20200521151556.pojijpmuc2rdd7ko@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 21, 2020 at 08:57:57AM -0700, Yu-cheng Yu wrote: > On Thu, 2020-05-21 at 10:15 -0500, Josh Poimboeuf wrote: > > On Wed, Apr 29, 2020 at 03:07:06PM -0700, Yu-cheng Yu wrote: > > > Control-flow Enforcement (CET) is a new Intel processor feature that blocks > > > return/jump-oriented programming attacks. Details can be found in "Intel > > > 64 and IA-32 Architectures Software Developer's Manual" [1]. > > > > > > This series depends on the XSAVES supervisor state series that was split > > > out and submitted earlier [2]. > > > > > > I have gone through previous comments, and hope all concerns have been > > > resolved now. Please inform me if anything is overlooked. > > > > > > Changes in v10: > > > > Hi Yu-cheng, > > > > Do you have a git branch with the latest Shadow Stack and IBT branches > > applied? I tried to apply IBT v9 on top of this, but I guess the SS > > code has changed since then and it didn't apply cleanly. > > It is here: > > https://github.com/yyu168/linux_cet/commits/cet Thanks. FYI, I got the following warning on an AMD system. [ 18.936979] get of unsupported state [ 18.936989] WARNING: CPU: 251 PID: 1794 at arch/x86/kernel/fpu/xstate.c:919 get_xsave_addr+0x83/0x90 [ 18.949676] Modules linked in: [ 18.952731] CPU: 251 PID: 1794 Comm: dracut-rootfs-g Not tainted 5.7.0-rc6+ #162 [ 18.960121] Hardware name: AMD Corporation DAYTONA_X/DAYTONA_X, BIOS RDY1005C 11/22/2019 [ 18.968198] RIP: 0010:get_xsave_addr+0x83/0x90 [ 18.972637] Code: 5b c3 48 83 c4 08 31 c0 5b c3 80 3d f9 c2 7a 01 00 75 bc 48 c7 c7 c4 cb 8f a9 89 74 24 04 c6 05 e5 c2 7a 01 01 e8 3f 49 0a 00 <0f> 0b 8b 74 24 04 eb 9d 31 c0 c3 66 90 0f 1f 44 00 00 48 89 fe 0f [ 18.991373] RSP: 0018:ffffb8db103cfcd8 EFLAGS: 00010286 [ 18.996591] RAX: 0000000000000000 RBX: ffff947da1189440 RCX: 0000000000000000 [ 19.003715] RDX: 0000000000000000 RSI: ffffffffaa6809d8 RDI: ffffffffaa67e58c [ 19.010839] RBP: ffff947da1188000 R08: 0000000468bb5e6c R09: 0000000000000018 [ 19.017962] R10: 0000000000000002 R11: 00000000000000f0 R12: ffffb8db103cfd20 [ 19.025087] R13: ffff947da1189400 R14: 0000000000000000 R15: 0000000000000007 [ 19.032211] FS: 00007f0a81b15740(0000) GS:ffff947dcf8c0000(0000) knlGS:0000000000000000 [ 19.040321] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 19.046057] CR2: 00007f0a81b156c0 CR3: 0000003fa125a000 CR4: 0000000000340ee0 [ 19.053183] Call Trace: [ 19.055637] cet_restore_signal+0x26/0xf0 [ 19.059649] __fpu__restore_sig+0x4cc/0x6e0 [ 19.063832] ? remove_wait_queue+0x20/0x60 [ 19.067928] ? reuse_swap_page+0x6e/0x340 [ 19.071939] restore_sigcontext+0x162/0x1b0 [ 19.076128] ? recalc_sigpending+0x17/0x50 [ 19.080223] ? __set_task_blocked+0x34/0xa0 [ 19.084401] __do_sys_rt_sigreturn+0x92/0xde [ 19.088675] do_syscall_64+0x55/0x1b0 [ 19.092342] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 19.097394] RIP: 0033:0x7f0a811389d1 [ 19.100970] Code: 64 c7 00 16 00 00 00 b8 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 f3 0f 1e fa 41 ba 08 00 00 00 b8 0e 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 07 c3 66 0f 1f 44 00 00 48 8b 15 81 44 38 00 [ 19.119709] RSP: 002b:00007ffd643d5dd8 EFLAGS: 00000246 [ 19.124933] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00007f0a811389d1 [ 19.132056] RDX: 0000000000000000 RSI: 00007ffd643d5e60 RDI: 0000000000000002 [ 19.139182] RBP: 000055e140190e20 R08: 000055e14017a014 R09: 0000000000000001 [ 19.146307] R10: 0000000000000008 R11: 0000000000000246 R12: 000055e13f47e4e0 [ 19.153436] R13: 00007ffd643d5e60 R14: 0000000000000000 R15: 0000000000000000