From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id BF6F43858C83 for ; Tue, 18 Oct 2022 15:04:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BF6F43858C83 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666105447; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=kTTV3U44tFMv8uS/V+GJww2HSnBd4Qc6igb60nIy/M0=; b=WhvZQ/o+/66hZco/YIl8v7akrEDm/xxDDVpa9aE9bXVDJJ9oeo+x1PwgOcnFL9+s5ielnh WCKLa1qQYOzmONOHBtXdefZI6+2XZrzrwEu4+4cWUty1rBDQCMIwhP3ulAe200fDVbV46C IruqufST7rxOT+0z220C2FKK61ceFxU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-464-h6Svg7kHMMe4Sn_ng19wqA-1; Tue, 18 Oct 2022 11:04:04 -0400 X-MC-Unique: h6Svg7kHMMe4Sn_ng19wqA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 92430802546; Tue, 18 Oct 2022 15:03:58 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.16.74]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F13FE40C206B; Tue, 18 Oct 2022 15:03:50 +0000 (UTC) From: Florian Weimer To: Adhemerval Zanella Netto Cc: libc-alpha@sourceware.org, DJ Delorie Subject: Re: [PATCH 2/3] Introduce , extracted from References: Date: Tue, 18 Oct 2022 17:03:48 +0200 In-Reply-To: (Adhemerval Zanella Netto's message of "Mon, 17 Oct 2022 13:13:10 -0300") Message-ID: <87lepdi36z.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: * Adhemerval Zanella Netto: > On 13/10/22 09:20, Florian Weimer via Libc-alpha wrote: >> This allows us to define a generic no-op version of PTR_MANGLE and >> PTR_DEMANGLE. In the future, we can use PTR_MANGLE and PTR_DEMANGLE >> unconditionally in C sources, avoiding an unintended loss of hardening >> due to missing include files or unlucky header inclusion ordering. > > Could we also improve the generic implementation to always XOR with the > pointer guard and move it to be a proper static inline function? I think > we can then remove a lot of boilerplate code each architecture need to > have. I think the assembler implementation in part aims to avoid leaving the plain guard value behind in a register, at least on some targets. >> In i386 and x86_64, we can avoid a dependency in the C >> code by using the computed constant from . >> no longer includes these definitions, so there is no cyclic dependency >> anymore when computing the constants. > > LGTM, thanks. > > Reviewed-by: Adhemerval Zanella Thanks, Florian