From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS17314 8.43.84.0/22 X-Spam-Status: No, score=-3.3 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,PDS_RDNS_DYNAMIC_FP, RCVD_IN_DNSWL_MED,RDNS_DYNAMIC,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id D137A1F8C6 for ; Thu, 29 Jul 2021 16:08:56 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B343139DC4E5 for ; Thu, 29 Jul 2021 16:08:55 +0000 (GMT) Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com [68.232.141.98]) by sourceware.org (Postfix) with ESMTPS id E44FD39CE1FE for ; Thu, 29 Jul 2021 16:08:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E44FD39CE1FE Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com IronPort-SDR: u8Gx9TcIg/jmDUjAXWzXiMEl4PV2RFa+qWihCCufuetPpIF9fxtm2PVmpIxEKnnWWck/010aEk OsGPt2RlGrWe7DSU83FretSHYDHzR+B4Zv8+I0IOiUML3Fw2HBTbxhm14O1wjZib39PSBqgCiY gENiC6FPIRfE92NvUgVL6jke/tv8Uo8YPak/wOqVWC4P6GTbOFPVau3pAzlffifwfCKCWHHsp7 Bq6URG4E6khrxRkGXAFw5qNlJnYuqBkhX4apxC3Z8eLeJ3oxT7Zdzbfu4O5taE9j/CImz5quQl T+Sl3GalcJMMAJ6LksrXMRLr X-IronPort-AV: E=Sophos;i="5.84,278,1620720000"; d="scan'208";a="64068522" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 29 Jul 2021 08:08:41 -0800 IronPort-SDR: pJIeDIbIYk7J17lwFYRGhMC2+R8Kg1OMZFCgJuqAHJXVENdW8lUnPMGkGEp21C3fGhwKh9CF6u 7EBKUG2YnO0vClHLn8Yi+X2O0U6Hh2sf4Guv+DncH+aw/RN42PbEsq94RnPut0rAp/YkvX2E08 W3eh9klTP1BaakocdorjMOXm1CdZXQFFFtsZ/q/XZHx65BkhqLEwAAQz1kGa+t2mIUYUSNkq13 3R1GTSywonvaxrQwYkxHoaPQpZOx0k1dT+2kiXAMDLXWKfSMT7Zf1jmE1u9dSdiUjQs7TAOs0C aac= Date: Thu, 29 Jul 2021 16:08:36 +0000 From: Joseph Myers X-X-Sender: jsm28@digraph.polyomino.org.uk To: Florian Weimer Subject: Re: Named address spaces on x86 GNU/Linux In-Reply-To: <87czr12u3t.fsf@oldenburg.str.redhat.com> Message-ID: References: <87czr12u3t.fsf@oldenburg.str.redhat.com> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-09.mgc.mentorg.com (139.181.222.9) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: gcc@gcc.gnu.org, libc-alpha@sourceware.org Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" On Thu, 29 Jul 2021, Florian Weimer via Gcc wrote: > On GNU/Linux, SEGFS is used to implement the thread pointer, to avoid > dedicating a general-purpose register to it. At address zero with the > SEGFS prefix, the offset itself is stored so that userspace can read it > without having to call into the kernel. So the SEGFS null pointer is a > valid address, and so are some bytes after it (depending on TCB layout, > some of which is specified by the ABI or is part of the de-facto ABI > used by GCC). That suggests that we need a target hook to describe null pointer properties for a given address space. In an address space where null pointers are valid to dereference, there should be no diagnostics for arithmetic on / dereferencing them - and more generally, -fno-delete-null-pointer-checks should be in effect for pointers to such an address space (so I don't think this is just a warning issue, you can probably get wrong code from null pointer check deletion in such an address space). -- Joseph S. Myers joseph@codesourcery.com