Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp4310843rwn; Sun, 11 Sep 2022 09:14:05 -0700 (PDT) X-Google-Smtp-Source: AA6agR5I36VxzW43vfMN027Y5m/fBgeAC4Vb9qR4JNtay2DOMGcWYO2uae9B1GIeZZnIHIxDDYui X-Received: by 2002:aa7:dcd2:0:b0:44e:69f3:edd1 with SMTP id w18-20020aa7dcd2000000b0044e69f3edd1mr19172386edu.244.1662912845009; Sun, 11 Sep 2022 09:14:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662912845; cv=none; d=google.com; s=arc-20160816; b=blfswWVVIh+ZJQuCg/h+eDrTDDri+YLASnMhy4srDvccqZD2eCzwSBIMvjCpardOTG 3Ms8TvzJDGVYOwnaXKfIoLHh8xeFzYLbdYvSCKQ72gtfdBkv5Frf0h3t9kNkP1l7V6zQ 6w3d3zEqJPl2VVk53jrhhd3Ub+xYfNDfjA7jM6jtmpWFVQnHV0YQoLpOpYQTt11+BTr4 LLZh9091lcQ87VXW0bqnz7akw5BsNdsnXMpRFJHySd5y124MygfBACg4f5Mkd4sUpV8d DxWHNvoMe2Hhd5UASCkJdNkDlvBzdLmsC6A1Flb+NHL6uJatqDM8jQtsEqbwLX/ON8Fq Wm/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=INPmQn5PFVaEHIiQWvQas5OVd4nNfyK6qxmqNOcMzuQ=; b=ekvwWug+H2jFSGQDKvzAtRcJST14enXEjF0uPpZP2Br1MUfcYIDOHwqj/Lix84nnfv k4D1mU1x4e9o3rADw5+2i86CPfmp5/Xsch+AX4ZKAEmR/8PXKljpvYUQyYwnhJv16a7w rJBzslzocOD6BGUb40VxbeUhvsfc/c9MdQQEFzGEKywPTMdM5OkYtxoiAJl87pJ/d7Er 7DTEpexjvQ4ZQrxdKtiEXaN+FCDWkwDyVdp3JqUIWTQIzrScXWX0E2uqb8ZeEbXt13Di 7zBMjbOKBgk3SUtYEHmwVTdzR+wW1epD1MhGxNu0zza85de1I9ux+qpttwU97BPrVJPS QuTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oO8Niz22; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x19-20020a1709064bd300b00734be0ce0e5si3480267ejv.311.2022.09.11.09.13.38; Sun, 11 Sep 2022 09:14:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oO8Niz22; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229742AbiIKPbp (ORCPT + 99 others); Sun, 11 Sep 2022 11:31:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229543AbiIKPbm (ORCPT ); Sun, 11 Sep 2022 11:31:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84DF5220C1; Sun, 11 Sep 2022 08:31:41 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EAAC361035; Sun, 11 Sep 2022 15:31:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 56D23C43141; Sun, 11 Sep 2022 15:31:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662910300; bh=f4ZjQtH1Kb0CE5y0VGooWc8Wwj1HiVheMrl2j8fAjUk=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=oO8Niz22F7cR9uhxQCzGa6wr02G8Syb9kA9rA9StaItcNtzrQ9KWhSQ8TwS4hZED0 OtHWcXjICpsCtwg8J3ty45NOtRKK7bIvlpd6UBV1lHAMEsTBb8X8DY1qgRgf19tXxJ rQLpRhCGTY7hVuFjg7TJq1pbZxVNEu1pFIDGR4MD7b6RmKxwsFzAaVX/a6bJ7q+NTb kEWQK3ZtenVrQeqp0BibUa9OTFhI+w4AY4bz5NrPn5+KBiBsQNBDroF2HBOYqmah/G aMFAGA2CW05mXcBKMndx6BdDZQiw4OJpw0hqWLDrFdQb/kD5iiuSUE4eCVaXr/Fe2W kIvEc5J3Ay40Q== Received: by mail-lf1-f50.google.com with SMTP id f14so10006807lfg.5; Sun, 11 Sep 2022 08:31:40 -0700 (PDT) X-Gm-Message-State: ACgBeo2oEA8vS23zVOj7qgQswaFcd4yC3uranno1dYHwyRxwD51Ntx7R QHZZbdjYhaQ+jQ/BvQ0NxZUHDhcKNvKlgMtU6+8= X-Received: by 2002:ac2:4431:0:b0:497:aaf5:83eb with SMTP id w17-20020ac24431000000b00497aaf583ebmr6784950lfl.228.1662910298289; Sun, 11 Sep 2022 08:31:38 -0700 (PDT) MIME-Version: 1.0 References: <20220909180704.jwwed4zhwvin7uyi@treble> In-Reply-To: From: Ard Biesheuvel Date: Sun, 11 Sep 2022 16:31:27 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC] Objtool toolchain proposal: -fannotate-{jump-table,noreturn} To: Peter Zijlstra Cc: Josh Poimboeuf , linux-toolchains@vger.kernel.org, Indu Bhagat , Nick Desaulniers , linux-kernel@vger.kernel.org, "Jose E. Marchesi" , Miroslav Benes , Mark Rutland , Will Deacon , x86@kernel.org, linux-arm-kernel@lists.infradead.org, live-patching@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Chen Zhongjin , Sathvika Vasireddy , Christophe Leroy , Mark Brown Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 11 Sept 2022 at 16:26, Peter Zijlstra wrote: > > On Fri, Sep 09, 2022 at 11:07:04AM -0700, Josh Poimboeuf wrote: > > Alternatives > > ------------ > > > > Another idea which has been floated in the past is for objtool to read > > DWARF (or .eh_frame) to help it figure out the control flow. That > > hasn't been tried yet, but would be considerably more difficult and > > fragile IMO. > > I though Ard played around with that a bit on ARM64. And yes, given that > most toolchains consider DWARF itself best-effort, I'm not holding my > breath there. > I have patches out that use unwind data to locate pointer auth sign/authenticate instructions in the code, in order to patch them to shadow call stack pushes and pops at runtime if pointer authentication is not supported by the hardware. This has little to do with objtool or reliable stack traces. I still think DWARF could help to make objtool's job a bit easier, but I don't think it will be of any use with jump tables or noreturn functions in particular.