Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp620416pxy; Wed, 28 Apr 2021 10:37:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzs4xtokJw0dySLuCLYBoiAt0ECppzr2aBlZTZy/jW7oAKMw/Xn6ANIBDbgKRa+Uq7XSIGe X-Received: by 2002:a17:907:399:: with SMTP id ss25mr8525109ejb.134.1619631426433; Wed, 28 Apr 2021 10:37:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619631426; cv=none; d=google.com; s=arc-20160816; b=ZdtKuHDM46fD2nZT6Xz/AoNsNd9mL0XutDm7xxSD5idev7sdC1jnhXmjONdHv5FYPS fmyDdGd3xfcdC6OmUb2geYkHFOTbychHJjoLF4Ep70V9fB+zYwemmFq3piJHY5MNusGK JeGbHVlA2sPXfxWpyOHpS4WxuxAFt9SH6z1L5wMeVDKYaqKZZYUsjsXtsMm+UePbeN9I cRHUi0PqsDwGThjZ3sD4tWbM0m/McR738cJJ7CX3V0DvXPvdfy5JXZkSs6e3SKq8nuBe Ah0oKMZHLiGnzkYgB3aCEzKyA0pIrPKpC08R/P3WNaD9hb7BZskkDo+hTo+lIcmOryXE hnSA== 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=ZZDWp3D2qMdUP2gKWwupNfXxgKpQm1/v8BzMNeh5EeY=; b=cp6iI9CYnNEmRMMhHf3mWwV57RspVP+SVHmHA0T3dL3nqy93NXN4VJpvSDmHJcmMzd WNaTwVRBRQLZFaa3hA1ZnadOxBCt5LfsL9b40XtliuxSKujkDz9PmV/GWsoIwv+8VyBv PU3pnz2vnXxcOPSbuE6prQniYT0Ya6T7rp6C4XpF6RsAUzpBB16PUK15+WnxJVbAXX1q upxeUenXQ2SErCo6prLLZAcdSnIIFSmGVUwu6oA9behBQbLsHWmnXZIqysgzAvnV34Qe ZYjkzvZo9HX8UkYSm3IMNiczQ+NDvKPPn4S9Yv7SuPwI7z8XkE6NP28S7A/73Fmy0Atz m1kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ScedMa4p; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s8si608460ejq.612.2021.04.28.10.36.40; Wed, 28 Apr 2021 10:37:06 -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=@kernel.org header.s=k20201202 header.b=ScedMa4p; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239751AbhD1PPg (ORCPT + 99 others); Wed, 28 Apr 2021 11:15:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:35704 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229805AbhD1PPf (ORCPT ); Wed, 28 Apr 2021 11:15:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5A71A61434 for ; Wed, 28 Apr 2021 15:14:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619622890; bh=4Ws0+en3jeqx+lcLETHxSaMmCbFj64akFU1VEPRBU+0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=ScedMa4pTRrbMQMckrxWa/W5fytapGxMaxWDH0qlymRF2Y9VLNEfZ52a8gzMHsd52 2ryrys+CYOK1xWIKrSs7xIDsGaZo0qKjaTOAxk8nNreE5vd1fGw4viUeltjoLfBNIP HW8ySxMLlVoJNC29I9nCwWa1D76Zyk8vD5A/UPgMvlRmNd7LsqZzo/XF4JdhrvD4EU HJ/OMpNw5to/qNYpA2J3gev0yOy5iopChmSc0MSy+m0m0zctmONRp8W0ey7BsyBMYF UWXAHkifj/C3aJ1/51ufonU1ECY9WqyF1vtGSrN67dWbBEI3Wcrkh86DyUZgtvil1i Id7nJ/+1aZj1Q== Received: by mail-ed1-f41.google.com with SMTP id n25so2593623edr.5 for ; Wed, 28 Apr 2021 08:14:50 -0700 (PDT) X-Gm-Message-State: AOAM5319X73oqW2ci/CwBr8rZCiG+pz1ompwpecBckiDs5UXEa8Tk5I1 oEEnA3omiR1+m3H1fGeu2kF+YApWsyFPU5bomcZ4AA== X-Received: by 2002:a50:fc91:: with SMTP id f17mr11825671edq.23.1619622888769; Wed, 28 Apr 2021 08:14:48 -0700 (PDT) MIME-Version: 1.0 References: <20210427204720.25007-1-yu-cheng.yu@intel.com> <0e03c50ea05440209d620971b9db4f29@AcuMS.aculab.com> In-Reply-To: From: Andy Lutomirski Date: Wed, 28 Apr 2021 08:14:37 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v26 0/9] Control-flow Enforcement: Indirect Branch Tracking To: "H.J. Lu" Cc: Andy Lutomirski , David Laight , Yu-cheng Yu , "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 , Balbir Singh , Borislav Petkov , Cyrill Gorcunov , Dave Hansen , Eugene Syromiatnikov , Florian Weimer , 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 , Pengfei Xu , Haitao Huang Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 28, 2021 at 7:57 AM H.J. Lu wrote: > > On Wed, Apr 28, 2021 at 7:52 AM Andy Lutomirski wrote: > > > > On Wed, Apr 28, 2021 at 7:48 AM David Laight wrote: > > > > > > From: Yu-cheng Yu > > > > Sent: 27 April 2021 21:47 > > > > > > > > Control-flow Enforcement (CET) is a new Intel processor feature that blocks > > > > return/jump-oriented programming attacks. Details are in "Intel 64 and > > > > IA-32 Architectures Software Developer's Manual" [1]. > > > ... > > > > > > Does this feature require that 'binary blobs' for out of tree drivers > > > be compiled by a version of gcc that adds the ENDBRA instructions? > > > > > > If enabled for userspace, what happens if an old .so is dynamically > > > loaded? > > CET will be disabled by ld.so in this case. What if a program starts a thread and then dlopens a legacy .so? > > > > Or do all userspace programs and libraries have to have been compiled > > > with the ENDBRA instructions? > > Correct. ld and ld.so check this. > > > If you believe that the userspace tooling for the legacy IBT table > > actually works, then it should just work. Yu-cheng, etc: how well > > tested is it? > > > > Legacy IBT bitmap isn't unused since it doesn't cover legacy codes > generated by legacy JITs. > How does ld.so decide whether a legacy JIT is in use?