Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3236360imu; Sat, 24 Nov 2018 00:46:19 -0800 (PST) X-Google-Smtp-Source: AJdET5fSo72EUvBunKZc4CcSHRNlWI/3WB60sE0Ahn/N/BYgXSNKMYSwfwLBrjKnSaUWB+Jg2ihH X-Received: by 2002:a62:fc52:: with SMTP id e79mr19598891pfh.8.1543049179679; Sat, 24 Nov 2018 00:46:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543049179; cv=none; d=google.com; s=arc-20160816; b=jwjlRjdyO3yRliim7HhgVRoY8mU10ft159y/h95MPZJlzQjb4jLEE1ftag9xx3QpUE LRVl6ikSR1QDiHYbQaGgqHrTDqMKrCztl/ktKTay6e9JYCU7T0otVF25lowpairX1EkZ QYO0LGkCQMYKobG/7vaN0kl9FY6fIevsle/DGiRmz6eNtbz4QIUUuBVaIkqTe6Pvp5m1 e6cXHSLLUPayoVCUKxcKDBmWMMHcqLc8WQVOmandrforGZkG8ihpC3vvdVtTnKM7ZLrH MdZIkQxc3Ze6ZtiZcdPvuqbZBEdTSldbMA7rwCAjtLEW52VQopNAX1zVRDbgh3bUHbnS Uk/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=CRspte/dp9YAChiP93gwXSjtgzPqIYMUnMQodGiKQRo=; b=J2qMU8XjalgkGOabElutCBwkaGrQ0mJezxBzpD5u0Xa/F5G2JNPvDIBNC5XiAJbnCL HOiEVqQUPayVHGndld4TiK4eGxIH+KTuusHzC7U4+H7NwgKLG1KfQIcpun6CkxqA3iGQ KQOHVDhELn1bKmw5SY8qA/wmRTN7lUnWtXBppL4n3iEPWcdk+zqlFfimcT9ZXMVv4h6U eKIJtFOspSWP6pGBw8+g4HfxxV3hNBOZ3BlG+v6uV+ueN4OmHA1TNvu9AzkBX1i8Z2bN skFdgNhHTHKtRD49Y5AVhwJBOruY+pq6K3paNA0D7Z9iMdRTFGjbjS+5llh7bcPMk6bN V0FQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m35si11737063pgb.246.2018.11.24.00.46.05; Sat, 24 Nov 2018 00:46:19 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2440992AbeKXEac (ORCPT + 99 others); Fri, 23 Nov 2018 23:30:32 -0500 Received: from 216-12-86-13.cv.mvl.ntelos.net ([216.12.86.13]:58538 "EHLO brightrain.aerifal.cx" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730951AbeKXEac (ORCPT ); Fri, 23 Nov 2018 23:30:32 -0500 Received: from dalias by brightrain.aerifal.cx with local (Exim 3.15 #2) id 1gQFVO-0000se-00; Fri, 23 Nov 2018 17:44:38 +0000 Date: Fri, 23 Nov 2018 12:44:38 -0500 From: Rich Felker To: Florian Weimer Cc: Mathieu Desnoyers , carlos , Joseph Myers , Szabolcs Nagy , libc-alpha , Thomas Gleixner , Ben Maurer , Peter Zijlstra , "Paul E. McKenney" , Boqun Feng , Will Deacon , Dave Watson , Paul Turner , linux-kernel , linux-api Subject: Re: [RFC PATCH v4 1/5] glibc: Perform rseq(2) registration at nptl init and thread creation Message-ID: <20181123174438.GL23599@brightrain.aerifal.cx> References: <686626451.10113.1542901620250.JavaMail.zimbra@efficios.com> <87wop5xeit.fsf@oldenburg.str.redhat.com> <1045257294.10291.1542905262086.JavaMail.zimbra@efficios.com> <87k1l5xd33.fsf@oldenburg.str.redhat.com> <20181122171010.GH23599@brightrain.aerifal.cx> <871s7cvt1l.fsf@oldenburg.str.redhat.com> <20181123142843.GJ23599@brightrain.aerifal.cx> <1150466925.11664.1542992720871.JavaMail.zimbra@efficios.com> <20181123173019.GK23599@brightrain.aerifal.cx> <87zhtzsngn.fsf@oldenburg.str.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87zhtzsngn.fsf@oldenburg.str.redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 23, 2018 at 06:39:04PM +0100, Florian Weimer wrote: > * Rich Felker: > > > On Fri, Nov 23, 2018 at 12:05:20PM -0500, Mathieu Desnoyers wrote: > >> There has been presumptions about signals being blocked when the thread > >> exits throughout this email thread. Out of curiosity, what code is > >> responsible for disabling signals in this situation ? Related to this, > >> is it valid to access a IE model TLS variable from a signal handler at > >> _any_ point where the signal handler nests over thread's execution ? > >> This includes early start and just before invoking the exit system call. > > > > It should be valid to access *any* TLS object like this, but the > > standards don't cover it well. > > C++ makes it undefined: > > C also leaves access to pretty much anything from a signal handler undefined, but that makes signals basically useless. POSIX inadvertently defines a lot more than it wanted to by ignoring indirect ways you can access objects using AS-safe functions to pass around their addresses; there's an open issue for this: http://austingroupbugs.net/view.php?id=728 I think it's reasonable to say, based on how fond POSIX is of signals for realtime stuff, that it should allow some reasonable operations, but just be more careful about what it allows, and disallowing access to TLS would preclude the only ways to make signals non-awful for multithreaded processes. Rich