Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp767485ybi; Fri, 14 Jun 2019 03:03:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqzx+P5cum9VSM08UYV69fPQJPV3m16iUmGlKehjMcBnKlzs0qnJFYkcQmfkwJgLICqM6pSr X-Received: by 2002:a17:902:7894:: with SMTP id q20mr83045345pll.339.1560506627588; Fri, 14 Jun 2019 03:03:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560506627; cv=none; d=google.com; s=arc-20160816; b=zOtIa37/8A+zye9o2hKN5PsHW6y53dgMBEg+G5rvtCpO+5vV+OTbvpLRNM1EaOpFFY gSiO9ncY6J/N9vTtjRAI9CKIGDCx/MuU6BpxAXcegK/F71gh2ii94b+8Zqk8OsUFKct+ foHCNNWGaT0xbwL92T/EzrDYJLI+jmvqlCam5X/8M5Ca0X9b/BJcvkYFNQxs1E0g1/OT qqjwZDKWOIf2lmW8xO6TC5G86LpKWIka8MI+EVzTNqnjbAs9rbb9xdUPg7VCajZGCgD+ oOauQUkzACwX+88BgSRsF8UyoKYjiUaSd88att20c4fuBALQVw1jENAMf/Vabgf5q/7E BN3A== 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=Hu2sfywP1wr/V2iml0Iwu3DskdZlle9a1sk8RIwPbAc=; b=pIY/TgI8v5l+S8G+PFAPkOHABV4MSbpqII4K8RTEfTsQ35clwoVWgKw240V7SyGNiL Zvv/N2FHqZC2G7iKj4id2OpFf+XfRMoxT1aQf5CVAXFPh0JTwvpLIrXJRn0hiJFwSrP1 rXev3QBG5W3GnwU3G5k+y6+XsOxXWSb52GXKyTgaMcvTrZnnE8Q+/8XVo4jO8q1RXF5/ v5qZv9iQ44ZzFJAYwzslbmCyxgrlUNnY0CSTT3Fr3SmFfd6Sc2LiOFhh8XCnvON8bgeT /8SI2f+HOYqIBHNNvwC9bPuUy5YSwTbKaoDWc3WvvrTNEH1N7UB6XSM8Ot6CTt6oiIeX Y7qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@efficios.com header.s=default header.b=fvSF4UnS; 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=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c2si1988408pfr.5.2019.06.14.03.03.30; Fri, 14 Jun 2019 03:03:47 -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; dkim=pass header.i=@efficios.com header.s=default header.b=fvSF4UnS; 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=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727331AbfFNKDH (ORCPT + 99 others); Fri, 14 Jun 2019 06:03:07 -0400 Received: from mail.efficios.com ([167.114.142.138]:33086 "EHLO mail.efficios.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727197AbfFNKDH (ORCPT ); Fri, 14 Jun 2019 06:03:07 -0400 Received: from localhost (ip6-localhost [IPv6:::1]) by mail.efficios.com (Postfix) with ESMTP id B2F3A251338; Fri, 14 Jun 2019 06:03:05 -0400 (EDT) Received: from mail.efficios.com ([IPv6:::1]) by localhost (mail02.efficios.com [IPv6:::1]) (amavisd-new, port 10032) with ESMTP id aGDopCXhabIV; Fri, 14 Jun 2019 06:03:05 -0400 (EDT) Received: from localhost (ip6-localhost [IPv6:::1]) by mail.efficios.com (Postfix) with ESMTP id 455F4251331; Fri, 14 Jun 2019 06:03:05 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com 455F4251331 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1560506585; bh=Hu2sfywP1wr/V2iml0Iwu3DskdZlle9a1sk8RIwPbAc=; h=Date:From:To:Message-ID:MIME-Version; b=fvSF4UnSVmbjIlv9Khoar4edqsd+o8saf61h4OK1+vIa0MgvAEnu/UKIG6N0a3apx tiA7uuHAHRZy4dE8/w6aFGS05JUYkzKpfU/Hp0sUR8dLGa1RTyvIoc1RcI+Zqs8uww EhYjeSssh2WOJo4xfeApdEIr7FfjxCje1SFA8lyywbM541+2WbLuP8fp/9665+tgwf upU2nGhuAZzX4ZgGUyxKMvD1Gy32eTP5WwAiGaTvDqWB9L8AurGI/iNK96XYEqjGr8 x870WRvXafGceB05ZQ0JHYiemFDLtNq8m2mtALm2Yrm9zKcaFGc6IoKaFgaHfxL6kx dzXk3iMwytTeQ== X-Virus-Scanned: amavisd-new at efficios.com Received: from mail.efficios.com ([IPv6:::1]) by localhost (mail02.efficios.com [IPv6:::1]) (amavisd-new, port 10026) with ESMTP id LKwutttasM3j; Fri, 14 Jun 2019 06:03:05 -0400 (EDT) Received: from mail02.efficios.com (mail02.efficios.com [167.114.142.138]) by mail.efficios.com (Postfix) with ESMTP id 1BD4A251327; Fri, 14 Jun 2019 06:03:05 -0400 (EDT) Date: Fri, 14 Jun 2019 06:03:04 -0400 (EDT) From: Mathieu Desnoyers To: carlos , Florian Weimer Cc: Joseph Myers , Szabolcs Nagy , libc-alpha , Thomas Gleixner , Ben Maurer , Peter Zijlstra , "Paul E. McKenney" , Boqun Feng , Will Deacon , Dave Watson , Paul Turner , Rich Felker , linux-kernel , linux-api Message-ID: <802638054.3032.1560506584705.JavaMail.zimbra@efficios.com> In-Reply-To: <914051741.43025.1560348011775.JavaMail.zimbra@efficios.com> References: <20190503184219.19266-1-mathieu.desnoyers@efficios.com> <87muj2k4ov.fsf@oldenburg2.str.redhat.com> <1528929896.22217.1559326257155.JavaMail.zimbra@efficios.com> <87o93d4lqb.fsf@oldenburg2.str.redhat.com> <117220011.27079.1559663870037.JavaMail.zimbra@efficios.com> <87wohzorj0.fsf@oldenburg2.str.redhat.com> <914051741.43025.1560348011775.JavaMail.zimbra@efficios.com> Subject: Re: [PATCH 1/5] glibc: Perform rseq(2) registration at C startup and thread creation (v10) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [167.114.142.138] X-Mailer: Zimbra 8.8.12_GA_3803 (ZimbraWebClient - FF67 (Linux)/8.8.12_GA_3794) Thread-Topic: glibc: Perform rseq(2) registration at C startup and thread creation (v10) Thread-Index: 6rG93gdkMSoHS5ZP168diTIrRPG9C+LZilEL Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ----- On Jun 12, 2019, at 4:00 PM, Mathieu Desnoyers mathieu.desnoyers@efficios.com wrote: > ----- On Jun 10, 2019, at 4:43 PM, carlos carlos@redhat.com wrote: > >> On 6/6/19 7:57 AM, Florian Weimer wrote: >>> Let me ask the key question again: Does it matter if code observes the >>> rseq area first without kernel support, and then with kernel support? >>> If we don't expect any problems immediately, we do not need to worry >>> much about the constructor ordering right now. I expect that over time, >>> fixing this properly will become easier. >> >> I just wanted to chime in and say that splitting this into: >> >> * Ownership (__rseq_handled) >> >> * Initialization (__rseq_abi) >> >> Makes sense to me. >> >> I agree we need an answer to this question of ownership but not yet >> initialized, to owned and initialized. >> >> I like the idea of having __rseq_handled in ld.so. > > Very good, so I'll implement this approach. Sorry for the delayed > feedback, I am traveling this week. I had issues with cases where application or LD_PRELOAD library also define the __rseq_handled symbol. They appear not to see the same address as the one initialized by ld.so. I tried using the GL() macro in ld.so to set __rseq_handled, but it's the wrong address compared to what the preload lib and application observe. Any thoughts on how to solve this ? Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com