Received: by 2002:a17:90a:37a3:0:0:0:0 with SMTP id v32csp4104913pjb; Mon, 10 Jun 2019 10:30:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqwsoyfd/HThVnvf9AJVnNVlLnzziz/X8kPQOr4XctVJUJeNLhBXZCgOn2YZO9QhTp5ZXcC+ X-Received: by 2002:a17:902:4181:: with SMTP id f1mr69007189pld.22.1560187836058; Mon, 10 Jun 2019 10:30:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560187836; cv=none; d=google.com; s=arc-20160816; b=0xoNNWAqyvAh3HxoB+UOrl0wXcl0N1M30N5Axwvd6VtZGk9EcCONELjQgk7+LA9t5J z8g/rzmuSMAXNdFf15EsMP67SEBVuvNg6bFbOhPPqzv+qxRY62mInF1xVmWM7v3el4A3 W/ZIqtUcTb0WzPY9TXLxgJ8rGXrxGZS7AunBNZ9dVaEHZ0a/X5CbaTLhVX52PInqs5vR u0TVSBxJ0dygu2va74z4xJ6f46FR3ZldTDZM+XslngdbwytXyi+/cVimalLXmC6Qua3f 3PkuBmp+EgbU8E3gOfvywhzNM23+BSU51/CIMrslfhG7/ev53m6LSSszr5pT1bVIYuTM E/nQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from; bh=edI7w/jdzY4VGdpt/zuxxeKV3jnPqOV6ruJzrmpXcBM=; b=fwHgufOW96G09db2BkgzKIwtna86HVsnU3NaJb0bpyV9s277GNpVz1H7ssCyBF4xDc lrAgHqAQ7gkpCcin7ltHjMwwbaDn1x/Q0yOhXWyZ5xd6eO2VLNcLy+gSy6wAL/k7U1nm HCKbk9EDFRlx/vKxT4W1FEeQ9AULV+aEPtxCfXJtUHnuZvU48sNSDb4plcXjrJeLOd7D f5hASHh/Ka0sFPMNChcqpo9ORhbFR2Q5rKGa8Hu8znYmvS8R2jnp16AFz13gMQKGY5SU aV73cOLLIRT2590cwuybX+tPcnySVset0yUAT6AL+wUz/3GIVFWgP4OsxPhOO5kTLzcT 7vVg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m8si9941011pgt.140.2019.06.10.10.30.19; Mon, 10 Jun 2019 10:30:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387834AbfFJR2x (ORCPT + 99 others); Mon, 10 Jun 2019 13:28:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43376 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727674AbfFJR2x (ORCPT ); Mon, 10 Jun 2019 13:28:53 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BA733C057E37; Mon, 10 Jun 2019 17:28:49 +0000 (UTC) Received: from oldenburg2.str.redhat.com (ovpn-117-27.ams2.redhat.com [10.36.117.27]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5D8DC5DD63; Mon, 10 Jun 2019 17:28:37 +0000 (UTC) From: Florian Weimer To: Yu-cheng Yu Cc: Dave Hansen , Andy Lutomirski , Peter Zijlstra , 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 , "H.J. Lu" , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Randy Dunlap , "Ravi V. Shankar" , Vedvyas Shanbhogue , Dave Martin Subject: Re: [PATCH v7 03/14] x86/cet/ibt: Add IBT legacy code bitmap setup function References: <20190606200926.4029-1-yu-cheng.yu@intel.com> <20190606200926.4029-4-yu-cheng.yu@intel.com> <20190607080832.GT3419@hirez.programming.kicks-ass.net> <20190607174336.GM3436@hirez.programming.kicks-ass.net> <34E0D316-552A-401C-ABAA-5584B5BC98C5@amacapital.net> <7e0b97bf1fbe6ff20653a8e4e147c6285cc5552d.camel@intel.com> <4b448cde-ee4e-1c95-0f7f-4fe694be7db6@intel.com> <0e505563f7dae3849b57fb327f578f41b760b6f7.camel@intel.com> <5dc357f5858f8036cad5847cfe214401bb9138bf.camel@intel.com> Date: Mon, 10 Jun 2019 19:28:36 +0200 In-Reply-To: <5dc357f5858f8036cad5847cfe214401bb9138bf.camel@intel.com> (Yu-cheng Yu's message of "Mon, 10 Jun 2019 09:05:13 -0700") Message-ID: <87h88xcptn.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 10 Jun 2019 17:28:53 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Yu-cheng Yu: > On Fri, 2019-06-07 at 14:09 -0700, Dave Hansen wrote: >> On 6/7/19 1:06 PM, Yu-cheng Yu wrote: >> > > Huh, how does glibc know about all possible past and future legacy code >> > > in the application? >> > >> > When dlopen() gets a legacy binary and the policy allows that, it will >> > manage >> > the bitmap: >> > >> > If a bitmap has not been created, create one. >> > Set bits for the legacy code being loaded. >> >> I was thinking about code that doesn't go through GLIBC like JITs. > > If JIT manages the bitmap, it knows where it is. > It can always read the bitmap again, right? The problem are JIT libraries without assembler code which can be marked non-CET, such as liborc. Our builds (e.g., orc-0.4.29-2.fc30.x86_64) currently carries the IBT and SHSTK flag, although the entry points into the generated code do not start with ENDBR, so that a jump to them will fault with the CET enabled. Thanks, Florian