Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3092872ybz; Mon, 27 Apr 2020 09:50:06 -0700 (PDT) X-Google-Smtp-Source: APiQypJEk7W0wXelduP8juM25qdVnYmlaLLQwmetN8SjNPoMwfObAxOTPthCx2BUxrlNkGqRiAOj X-Received: by 2002:a17:906:29c4:: with SMTP id y4mr20675697eje.95.1588006206631; Mon, 27 Apr 2020 09:50:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588006206; cv=none; d=google.com; s=arc-20160816; b=rUiNOA3gFuw6IsLqGW8OvwZ/cWxMdEMqMk36D5EOw45m3PED9eh2GRkYr1stCs6Cv7 CiFjS61jg/ywtlszhj1NwgT6wn+emH1+aoarL3OsOaGNfAJMPs9a3uJ+rYCb0px6bt45 H9kwLZIUidlgqXPyYluEad5u8nAmwT4lPJfHslKN8bqOe4h+Fxe9oB+DuIpoITlYzNbX d2/lmY+tLq7Sd5yXOkr/K/yPi3Zdppf4GgQGby2VjE1UAMH3xMXuuck8Tv+zfL5U2DSC QFhB03FmSLhLt5M3XNOK7bwJOy+u/GL9bXTEV9/B3MJ0Vz9M6G1xtYvaZv9ZahwUoPoW LPfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:thread-index:thread-topic :content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:dkim-signature:dkim-filter; bh=SCR0YXx7Ksd6h99vRKL/EL/KUijBXa/Pxw+bu0rC7s0=; b=J0Pb+Zy6D9BPYSqBccKVnGx8FP3ga6sfNwAN5qPjvRzncbnlqjANMKwaf4BGg9WjrV +upXcRhvxARBfo/H8ihRSUUd8Ia4zuNjJ6h7Ok6CEwvi0MEwCeuXDWo/T81ePqL2ikf6 cdu47mkWBJu6anAGhzoIcPaZOhXbpIoyr60gLa0Ygre9YGk1q9+PHX16UwcAtDbND8H3 RLgKo7Ot59DDrgHeOhp8Z5lPIAnQAShLvwCwS0tIaCthYOxC9KrEVdZXXM69k/SyLaOq SP2a1HPhPR/RAiCI1idCTwisl2VXM44wScHARyZHoMo3ze0NzTXiBpF6I2FS8xJbQv9N HCHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@efficios.com header.s=default header.b=XzBc9jhe; 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=efficios.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id pk26si89110ejb.404.2020.04.27.09.49.42; Mon, 27 Apr 2020 09:50: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=@efficios.com header.s=default header.b=XzBc9jhe; 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=efficios.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726384AbgD0QrN (ORCPT + 99 others); Mon, 27 Apr 2020 12:47:13 -0400 Received: from mail.efficios.com ([167.114.26.124]:45496 "EHLO mail.efficios.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726204AbgD0QrM (ORCPT ); Mon, 27 Apr 2020 12:47:12 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 3828A25ABA2; Mon, 27 Apr 2020 12:47:11 -0400 (EDT) Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 6kZC_M8qLWLq; Mon, 27 Apr 2020 12:47:11 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id E626125A555; Mon, 27 Apr 2020 12:47:10 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com E626125A555 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1588006030; bh=SCR0YXx7Ksd6h99vRKL/EL/KUijBXa/Pxw+bu0rC7s0=; h=Date:From:To:Message-ID:MIME-Version; b=XzBc9jheMqKkakYI4T8Slk1bFyXwnehB7UObX8kVXkYJLfX08xI5Z2kv2y36y68X8 WXVLBPxJ01RijyBeP+yZKKGD8DEaU1SJgIaYf+NJXhF5iWXoQLV8wJBdyKUSJukUVQ q4BhuocKu/3vgKQbbraPbhhe6FGkG+wgtv2DNFX6REUe8FdibYsSl0Khh5mz3N6bgc u6og0JGtglLEc9jUicZfuET+mo84zxJ2X8Tn5K7iItHkFDSFOerkZBDIF4hjqpudlb upqYZBGiSBjMjq4xV7p6klXNqaEDq4OAmcArVPTeOlx2VKGS4SW7BACoriYacfbkje xkHQNPDkyw3Tg== X-Virus-Scanned: amavisd-new at efficios.com Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id pxMlmkdvfxuZ; Mon, 27 Apr 2020 12:47:10 -0400 (EDT) Received: from mail03.efficios.com (mail03.efficios.com [167.114.26.124]) by mail.efficios.com (Postfix) with ESMTP id D4F4825A551; Mon, 27 Apr 2020 12:47:10 -0400 (EDT) Date: Mon, 27 Apr 2020 12:47:10 -0400 (EDT) From: Mathieu Desnoyers To: Florian Weimer Cc: libc-alpha , Carlos O'Donell , Rich Felker , linux-api , Boqun Feng , Will Deacon , linux-kernel , Peter Zijlstra , Ben Maurer , Dave Watson , Thomas Gleixner , Paul , Paul Turner , Joseph Myers Message-ID: <1660640739.70637.1588006030777.JavaMail.zimbra@efficios.com> In-Reply-To: <87ftcpxhpw.fsf@mid.deneb.enyo.de> References: <20200326155633.18236-1-mathieu.desnoyers@efficios.com> <20200326155633.18236-6-mathieu.desnoyers@efficios.com> <87ftcpxhpw.fsf@mid.deneb.enyo.de> Subject: Re: [PATCH glibc 5/9] glibc: Perform rseq(2) registration at C startup and thread creation (v17) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [167.114.26.124] X-Mailer: Zimbra 8.8.15_GA_3918 (ZimbraWebClient - FF75 (Linux)/8.8.15_GA_3895) Thread-Topic: glibc: Perform rseq(2) registration at C startup and thread creation (v17) Thread-Index: +/FwB08aOPyK5lJHGmbcAUAOKgI6cw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ----- On Apr 27, 2020, at 7:59 AM, Florian Weimer fw@deneb.enyo.de wrote: > * Mathieu Desnoyers via Libc-alpha: > >> diff --git a/elf/libc_early_init.c b/elf/libc_early_init.c >> index 1ac66d895d..30466afea0 100644 >> --- a/elf/libc_early_init.c >> +++ b/elf/libc_early_init.c >> @@ -18,10 +18,13 @@ >> >> #include >> #include >> +#include >> >> void >> __libc_early_init (void) >> { >> /* Initialize ctype data. */ >> __ctype_init (); >> + /* Register rseq ABI to the kernel. */ >> + (void) rseq_register_current_thread (); >> } > > I think the registration must be restricted to the primary namespace. > Otherwise, LD_AUDIT will register the area to the secondary libc (in > the audit module), not the primary libc for the entire process. > > I think the easiest way to implement this for now is a flag argument > for __libc_early_init (as the upstream __libc_multiple_libcs is not > entirely accurate). I will submit a patch. OK, once I get the patch, I will pick it up in my series. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com