From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl0-f71.google.com (mail-pl0-f71.google.com [209.85.160.71]) by kanga.kvack.org (Postfix) with ESMTP id 772926B0005 for ; Tue, 19 Jun 2018 16:47:36 -0400 (EDT) Received: by mail-pl0-f71.google.com with SMTP id 70-v6so456023plc.1 for ; Tue, 19 Jun 2018 13:47:36 -0700 (PDT) Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id b6-v6sor209435plk.85.2018.06.19.13.47.35 for (Google Transport Security); Tue, 19 Jun 2018 13:47:35 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: [PATCH 06/10] x86/cet: Add arch_prctl functions for shadow stack From: Andy Lutomirski In-Reply-To: Date: Tue, 19 Jun 2018 13:47:32 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <446EB18D-EF06-4A04-AF62-E72C68D96A84@amacapital.net> References: <20180607143807.3611-1-yu-cheng.yu@intel.com> <20180607143807.3611-7-yu-cheng.yu@intel.com> <1528403417.5265.35.camel@2b52.sc.intel.com> <569B4719-6283-4575-A16E-D0A78D280F4E@amacapital.net> <1529427588.23068.7.camel@intel.com> <0AF8B71E-B6CC-42DE-B95C-93896196C3D7@amacapital.net> Sender: owner-linux-mm@kvack.org List-ID: To: Kees Cook Cc: Yu-cheng Yu , Andy Lutomirski , "H. J. Lu" , Thomas Gleixner , LKML , linux-doc@vger.kernel.org, Linux-MM , linux-arch , X86 ML , "H. Peter Anvin" , Ingo Molnar , "Shanbhogue, Vedvyas" , "Ravi V. Shankar" , Dave Hansen , Jonathan Corbet , Oleg Nesterov , Arnd Bergmann , mike.kravetz@oracle.com, Florian Weimer > On Jun 19, 2018, at 1:12 PM, Kees Cook wrote: >=20 >> On Tue, Jun 19, 2018 at 10:20 AM, Andy Lutomirski w= rote: >>=20 >>> On Jun 19, 2018, at 10:07 AM, Kees Cook wrote: >>>=20 >>> Does it provide anything beyond what PR_DUMPABLE does? >>=20 >> What do you mean? >=20 > I was just going by the name of it. I wasn't sure what "ptrace CET > lock" meant, so I was trying to understand if it was another "you > can't ptrace me" toggle, and if so, wouldn't it be redundant with > PR_SET_DUMPABLE =3D 0, etc. >=20 No, other way around. The valid CET states are on/unlocked, off/unlocked, on= /locked, off/locked. arch_prctl can freely the state unless locked. ptrace c= an change it no matter what. The lock is to prevent the existence of a gadg= et to disable CET (unless the gadget involves ptrace, but I don=E2=80=99t th= ink that=E2=80=99s a real concern).=