Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3402493ybi; Mon, 10 Jun 2019 09:38:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqzQpDVWyahJRBAl8ro7NGDo2y7f5YS717NVn743wMUY6YvVFtUCYfNJKGX22QgXgD+pumaq X-Received: by 2002:a62:68c4:: with SMTP id d187mr77058083pfc.245.1560184723252; Mon, 10 Jun 2019 09:38:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560184723; cv=none; d=google.com; s=arc-20160816; b=vNYNWsFSAko5cXz+z4dY/H/3adevqGQMzyJMfcDANZh92UbDDbzFAKa4ChpU29jujD eSEI6x3fbXBpecgapmR5+b8SdVYbw/U8AEbgFVgFYFThSVglsMMu7oBTRtvM9jRIJlGX 9PO3HddX/2CFGn5bN0gk0GW7dU+QFIWG3PIZEVfifvTJqfwozMjIyrhWnAFUEBERx1bI gTzZTbY8w5oz6FJGjy7Q9O5h6ordoloU10xHKz1dnP41TCY/KBf6Eg5J4+fHujJT66qg c/IaHUBrkEWsgg+0nBL6cf2WQp0acRjmzCOAQ8B25r1XXzMr4M4LMEAbuA4xa1DHOQ6z kAeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=aHgdO29UtzVvri0V50TQMtM7S2F55KHF4sKCxD7/B9c=; b=Y7frLiqY4gEuigtSgrgUE9ouoHndUYWXN6VDH7/LkcQZ1n/qOE95r/uVrJNrikkhlt G3YVbk/3qtxiAhgKd9qeHThUJfBI/qR7E8HwFntX8p5Y69CEnRarVzBmPPl87rPpYQsD cX+AbbbCqr9ktWU864bR7Gt7ilkX7ZuEbqTeKladgYfA8AzW7iNCJVQPRniEcgPP4NUp trk0W950/ezol9OdSFOMjkrQtl3+sv7nfD8zJvF26Gxb6tyv2m+S7Nbm6q5G4aaPy4b4 N+IrXV+9OAsUHrAZqZs5HTnELYIEMBgVlau4zRuHLMY65d26CheaA/YB5Ysi5Bam2ho1 eZLg== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l1si10080788pjq.82.2019.06.10.09.38.28; Mon, 10 Jun 2019 09:38:43 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390989AbfFJQNV (ORCPT + 99 others); Mon, 10 Jun 2019 12:13:21 -0400 Received: from mga09.intel.com ([134.134.136.24]:55102 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388850AbfFJQNV (ORCPT ); Mon, 10 Jun 2019 12:13:21 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jun 2019 09:13:20 -0700 X-ExtLoop1: 1 Received: from yyu32-desk1.sc.intel.com ([143.183.136.147]) by FMSMGA003.fm.intel.com with ESMTP; 10 Jun 2019 09:13:19 -0700 Message-ID: <5dc357f5858f8036cad5847cfe214401bb9138bf.camel@intel.com> Subject: Re: [PATCH v7 03/14] x86/cet/ibt: Add IBT legacy code bitmap setup function From: Yu-cheng Yu To: Dave Hansen , Andy Lutomirski Cc: 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 , Florian Weimer , "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 Date: Mon, 10 Jun 2019 09:05:13 -0700 In-Reply-To: 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> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.1-2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? Yu-cheng