From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 93512C43465 for ; Fri, 18 Sep 2020 21:23:15 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 192512311D for ; Fri, 18 Sep 2020 21:23:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="F0fy8kNF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 192512311D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A3D1A6B0098; Fri, 18 Sep 2020 17:23:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9C4836B0099; Fri, 18 Sep 2020 17:23:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8662D6B009A; Fri, 18 Sep 2020 17:23:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0173.hostedemail.com [216.40.44.173]) by kanga.kvack.org (Postfix) with ESMTP id 722066B0098 for ; Fri, 18 Sep 2020 17:23:14 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 3A5FF181AEF23 for ; Fri, 18 Sep 2020 21:23:14 +0000 (UTC) X-FDA: 77277457908.09.grass27_0302df42712e Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin09.hostedemail.com (Postfix) with ESMTP id 2139C180AD802 for ; Fri, 18 Sep 2020 21:23:14 +0000 (UTC) X-HE-Tag: grass27_0302df42712e X-Filterd-Recvd-Size: 5625 Received: from mail-io1-f67.google.com (mail-io1-f67.google.com [209.85.166.67]) by imf28.hostedemail.com (Postfix) with ESMTP for ; Fri, 18 Sep 2020 21:23:13 +0000 (UTC) Received: by mail-io1-f67.google.com with SMTP id j2so8549210ioj.7 for ; Fri, 18 Sep 2020 14:23:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+R9udthszirp5ph1euFI7j8KgMqFMsoIf5y9goKTHNM=; b=F0fy8kNFKDpSAjjecuElAAjRNGjsnJXsuUSBhwtwBcrnGPYOSx3DRKvz5px9kBon/l SnWgPm3dtc0WY2+RMVwZawrEl2itpja3mltAQhJ8qX9jKuqWlgIqhs4cu0V9yV9pL72z 1nFanYT/DkvzHVwfKVKZ6Km1ReA2VrGtKKr+gd1hhMnqRA0yuv6Sd4ik3xWUz373B0CN R3JbqhuMKKi6y+3d2WJVFtYbZF+tONL+sXC3Csy6y9Ie5dXheOGx9TNypG3MhvSqqb6U Ve2ENc40ifV7SVjIk1qKnxGJygQE6Az8FTr9vne2CfaH5qJVbpbht0jhpXGIDc0VYs+u DgBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+R9udthszirp5ph1euFI7j8KgMqFMsoIf5y9goKTHNM=; b=Hx2wNj//r2v1f7KQciK8CU7qdOXC+sQ0s+12XCFCU+JYsV3RIslHBc8XdUGV92CedJ Ja6uOG+7WYNvZ9Xl8lFTT2gvugXsFi0djUbP6qBQLWBygPw1Cq1vGg7KqW274Tl9nc7u Cl5aU8jnN17lTgwpkWaXOc0I2NfWmZqZsuYp1vdKo+81fI/tniLyeJib51KUR/bmy/3h OCgIxWNcHQp8g+zzeFgc8Xs3cM8pv/WKqwFOjboGzxk2vLJOUHITx9zhw/tXHmg2BpHY GB5sQjXBE0xYFV/b/iAFpiddoHLMJSZrXQQa+fZRtHz/sCZxJtF4aQzprBBoBhkRMf9J Q0vw== X-Gm-Message-State: AOAM531TM+CkOe7MgPNjrs3R7682DKHuzXTTos+q5a+eLZJXi4qiB2qk dBZ2TMAC5Awilq9PT3ZgW56VxXXJijo0ob8Uni8= X-Google-Smtp-Source: ABdhPJxy1JeWoxWEO8/PRD1NozAezh60pVqQZrrCJ4a+ovrb+USFp35rUx2X1gOeuMWymf7scw0+anyVqWmN0JoPF6w= X-Received: by 2002:a5e:881a:: with SMTP id l26mr28068321ioj.51.1600464193161; Fri, 18 Sep 2020 14:23:13 -0700 (PDT) MIME-Version: 1.0 References: <20200918192312.25978-1-yu-cheng.yu@intel.com> <20200918192312.25978-9-yu-cheng.yu@intel.com> <20200918210026.GC4304@duo.ucw.cz> <4f93b106-53fc-40df-4c9b-c26490be24c8@intel.com> In-Reply-To: <4f93b106-53fc-40df-4c9b-c26490be24c8@intel.com> From: "H.J. Lu" Date: Fri, 18 Sep 2020 14:22:37 -0700 Message-ID: Subject: Re: [PATCH v12 8/8] x86: Disallow vsyscall emulation when CET is enabled To: Dave Hansen Cc: Pavel Machek , Yu-cheng Yu , "the arch/x86 maintainers" , "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , LKML , "open list:DOCUMENTATION" , Linux-MM , linux-arch , Linux API , Arnd Bergmann , Andy Lutomirski , Balbir Singh , Borislav Petkov , Cyrill Gorcunov , Dave Hansen , Eugene Syromiatnikov , Florian Weimer , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Peter Zijlstra , Randy Dunlap , "Ravi V. Shankar" , Vedvyas Shanbhogue , Dave Martin , Weijiang Yang Content-Type: text/plain; charset="UTF-8" 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: On Fri, Sep 18, 2020 at 2:17 PM Dave Hansen wrote: > > On 9/18/20 2:06 PM, H.J. Lu wrote: > > On Fri, Sep 18, 2020 at 2:00 PM Pavel Machek wrote: > >> On Fri 2020-09-18 12:32:57, Dave Hansen wrote: > >>> On 9/18/20 12:23 PM, Yu-cheng Yu wrote: > >>>> Emulation of the legacy vsyscall page is required by some programs > >>>> built before 2013. Newer programs after 2013 don't use it. > >>>> Disable vsyscall emulation when Control-flow Enforcement (CET) is > >>>> enabled to enhance security. > >>> How does this "enhance security"? > >>> > >>> What is the connection between vsyscall emulation and CET? > >> Boom. > >> > >> We don't break compatibility by default, and you should not tell > >> people to enable CET by default if you plan to do this. > >> > > Nothing will be broken. CET enabled applications don't use/need > > vsyscall emulation. > > Hi H.J., > > Could you explain your logic a bit more thoroughly, please? Here is my CET slides for LPC 2020: https://gitlab.com/cet-software/cet-smoke-test/-/wikis/uploads/09431a51248858e6f716a59065d732e2/CET-LPC-2020.pdf which may have answers for most questions. > I also suspect that Pavel was confused by your changelog where you said > that you do this when "CET is enabled". Does enabled in this context mean: > 1. Just CET support compiled in, or > 2. Compiled in and on CET hardware, or > 3. Compiled in to the kernel enabled in the app and running on CET > hardware? CET is enabled only in a process if 1. All components are CET enabled, and 2. CPU supports CET, and 3. Kernel supports CET. -- H.J.