Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1500984pxk; Fri, 18 Sep 2020 14:24:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxs1R5PzHT901z5l/W3oM+hMU8+KEbzx+Qphqmwcmp7ydtWYgc3+xVJECt38vsy/MnKG6X/ X-Received: by 2002:a50:fc83:: with SMTP id f3mr41994756edq.102.1600464283020; Fri, 18 Sep 2020 14:24:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600464283; cv=none; d=google.com; s=arc-20160816; b=VPUowo8tutsrfl/dPodx5qO8unQCzkmfc50B2VRIOiivAmi2dwskZuPTqq8h5bLgur h3JwyR/0NbBOkH7RdZHYe7Kgf+qiTjpJayr9oEuDkPFM8tSg16IU1qD9NNEAK15NXRqq hpSkad/gDH4uIX4O6LEeu0DUaol6BfqKA0xFK5qSz09QwvHLTLuCM3x9yqXJhxaZvq+G 2nOCIO7NiAS8l2SvAQF2FIqvC4iMb+NniVu2lsz0/qDFQii2y0HvcUf13AFCSBIuNu8m o58wZZaRsPFbflPphLJNiBSeiz6c+Xz3yHkCmS0aZMvZX+cLtKpgmRnnQeELhcwrJ0hR tbeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=+R9udthszirp5ph1euFI7j8KgMqFMsoIf5y9goKTHNM=; b=N9FzxPsFEzOih+A2aIDSLb6K8dJuoQOHc+b/WCeYcuHHwvh4mlMQf9yMFCZq3nw+M2 0lts7m0xMdsEvzxRhtSkThGfBe5s7otJ1JG1UshN+EzzDs3v24dgHRMXDUFqbXLIpmoP ml7NDyj263NGrczO00ag1yO7pyVlEz9OxBjCEw2M2PrO34weESQzb14P3sZLdAvDpgSl ay9609V83q2EaQM8qHuhbAzXEX2WqRUn/cvoZurmc82VGq7hwdBlsa7H7WMU8hR1EO2w ye4eP3AdfXmM3VsEJrXWBD1DoAuc6Q0jjNLZksh85wJwTgNHZt6DdH2r46px7rFKwLyb Cgfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=F0fy8kNF; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rh24si3115890ejb.283.2020.09.18.14.24.19; Fri, 18 Sep 2020 14:24:42 -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=@gmail.com header.s=20161025 header.b=F0fy8kNF; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726335AbgIRVXO (ORCPT + 99 others); Fri, 18 Sep 2020 17:23:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726118AbgIRVXN (ORCPT ); Fri, 18 Sep 2020 17:23:13 -0400 Received: from mail-io1-xd42.google.com (mail-io1-xd42.google.com [IPv6:2607:f8b0:4864:20::d42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C28CFC0613CE; Fri, 18 Sep 2020 14:23:13 -0700 (PDT) Received: by mail-io1-xd42.google.com with SMTP id z25so8521176iol.10; 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=BKN9q4u+bcWAaqRtd0A9lLjee1F163lVue6v+mADdxXmF6B+vfnJBkUxaWjkv8ku7Z C/75MuRpG4+p4d6oXQZbncFMbyCqAB5asE+6g2Q6zFRN3MWEP31vXN+dCbjRExom/pOd mOGdQpgKgqNcdQVoI7AOMmUwnGjOI2j1Hi/Qum+z7UiZ6i0x+RSX3J+pSp4AXvu70lIk wvhxcPw9qlcC6w1LjBHKTM6kjnlNpKw99GaR6c47g3ebOyye7YmN4wvVzwQEZw3GQjI2 G9KvM1cTisU7qrpsrDtks6hIJbEFJlDwhpRSmGDEoE947uQlR3lsI/rZB1Pl1yJQ/G7Z +6OQ== X-Gm-Message-State: AOAM533O/KaPt+1Xg6sfC5lmFhYGOM8zFm5oYlM4ivUafpMlHaCPCTz0 Rl757LiaiMgaZMMpzu/8F2gTw/wRB/lXIYPrkZg= 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" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.