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 7E73DC43461 for ; Wed, 28 Apr 2021 15:14:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EE66B61434 for ; Wed, 28 Apr 2021 15:14:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239803AbhD1PPf (ORCPT ); Wed, 28 Apr 2021 11:15:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:35706 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239786AbhD1PPf (ORCPT ); Wed, 28 Apr 2021 11:15:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 593BF6143C 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-f45.google.com with SMTP id g14so14998665edy.6 for ; Wed, 28 Apr 2021 08:14:50 -0700 (PDT) X-Gm-Message-State: AOAM530A/hbNmlkrl9j2Epa3XSPwyDIc2ISKK9JCueoH1C8ujuRuGS8i p6EYih5mqczFgM5Ig1l1c8q3haiogQfL51ERf5h/QQ== 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-api@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?