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.129.124]) by sourceware.org (Postfix) with ESMTPS id 05BA73858C66 for ; Thu, 12 Jan 2023 14:40:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 05BA73858C66 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=1673534407; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=q6v484xfbc34ZEcwUn+1byyoUdPByD48tNwI5LENEw4=; b=V7PxInTGlVwP+ofcQ8kVR6XBuvMP/ShamF10hR9rfqHTPth1tqfqmq125QJ34GOQ9r0iDL TpPacJqDuo3NSx4fPJmALrpOWJNGVJiMbDs+4PUSMU/GLWAI4HkEnKb5tX5ORL9hbl5k64 wgThEBQIDa0d+P1wyKFQMUEsdg05pCI= 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-325-yxxu23D7M-ylExLYkfpETQ-1; Thu, 12 Jan 2023 09:40:04 -0500 X-MC-Unique: yxxu23D7M-ylExLYkfpETQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AFF8B8030D4; Thu, 12 Jan 2023 14:40:03 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.223]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 64D322166B29; Thu, 12 Jan 2023 14:40:03 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 30CEe07k3418094 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 12 Jan 2023 15:40:00 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 30CEdx9j3418093; Thu, 12 Jan 2023 15:39:59 +0100 Date: Thu, 12 Jan 2023 15:39:58 +0100 From: Jakub Jelinek To: Wilco Dijkstra , Martin =?utf-8?B?TGnFoWth?= , Kyrylo Tkachov , Szabolcs Nagy , GCC Patches , richard.sandiford@arm.com Subject: Re: [PATCH] libgcc: Fix uninitialized RA signing on AArch64 [PR107678] Message-ID: Reply-To: Jakub Jelinek References: MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_MANYTO,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: On Thu, Jan 12, 2023 at 01:28:59PM +0100, Jakub Jelinek wrote: > > Although we don't AFAIK support using DW_CFA_undefined with RA signing, > > the failure mode would be non-obvious: it would effectively toggle the > > bit on. > > We don't install unwind-dw2.h nor give user code access to the how array > (and it just lives on the stack of __frame_state_for/uw_init_context_1 > functions and address of it is passed to functions called from it), > so I hope all this is private to the libgcc unwinder. After all, otherwise > e.g. the change how "how" is represented couldn't be done. > That said, if new enum entries are added in the generic code, then > I think uw_update_context_1 will warn about unhandled case in a switch, > unless we e.g. change > case REG_UNSAVED: > case REG_UNDEFINED: > break; > to > default: > break; > (and provided that the new enums would want such handling). > Another option is to just define the arch dependent value for how field > in the arch code, right now it is unsigned char type, so using say > (unsigned char) ~0 or (unsigned char) ~0 and (unsigned char) ~1 as arch > specific values might be ok too. Yet another option would be to define 1-2 extra REG_ values in the generic unwind-dw2.h header, but name them REG_ARCH_SPECIFIC_1, REG_ARCH_SPECIFIC_2, or so, and then the machine specific code can #define REG_AARCH64_TOGGLE_ON REG_ARCH_SPECIFIC_1 Of course, all this depends on whether the arch specific codes can be handled in uw_update_context_1 by doing break; there and nothing else. Jakub