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=-6.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 20452C43462 for ; Wed, 28 Apr 2021 15:14:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DFA256143C for ; Wed, 28 Apr 2021 15:14:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239827AbhD1PPg (ORCPT ); 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-Google-Smtp-Source: ABdhPJxwJpY1QIeAU6fDkKWgHdGb8D1MMF6TX8d4Wams5Yc1cZADwoIMzfDbopKAgEhXVvM9guavhPLCPGkwr5btYfc= 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? 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=-6.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 5FCCAC433B4 for ; Wed, 28 Apr 2021 15:14:58 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C59876143A for ; Wed, 28 Apr 2021 15:14:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C59876143A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 35E4F6B0071; Wed, 28 Apr 2021 11:14:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 30E506B0072; Wed, 28 Apr 2021 11:14:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1895E6B0073; Wed, 28 Apr 2021 11:14:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0194.hostedemail.com [216.40.44.194]) by kanga.kvack.org (Postfix) with ESMTP id ED0186B0071 for ; Wed, 28 Apr 2021 11:14:56 -0400 (EDT) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id B57CE2816 for ; Wed, 28 Apr 2021 15:14:56 +0000 (UTC) X-FDA: 78082123392.29.7D6A524 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf17.hostedemail.com (Postfix) with ESMTP id 8835C40002F7 for ; Wed, 28 Apr 2021 15:14:52 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 582BA6143A 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-f54.google.com with SMTP id i24so15095939edy.8 for ; Wed, 28 Apr 2021 08:14:50 -0700 (PDT) X-Gm-Message-State: AOAM5317PUJZ6FogWQ2kbcfykuig2+pklFIjpHBvJA6nFzT69hYssqPu cI5PGvJmOIr0VECf5n9I2RZxppcJyNNxy9Iqj0g5LA== X-Google-Smtp-Source: ABdhPJxwJpY1QIeAU6fDkKWgHdGb8D1MMF6TX8d4Wams5Yc1cZADwoIMzfDbopKAgEhXVvM9guavhPLCPGkwr5btYfc= 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" X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 8835C40002F7 X-Stat-Signature: b3yy8bxtprez1ubae9imyeecxub3esbr Received-SPF: none (kernel.org>: No applicable sender policy available) receiver=imf17; identity=mailfrom; envelope-from=""; helo=mail.kernel.org; client-ip=198.145.29.99 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1619622892-244938 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 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?