Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2406355ioo; Sat, 28 May 2022 12:37:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKlBynIEcfr7Q/XuE/F2r/s4eXxdo4r5p1oGRFwFAkiepexmz5dn0k8m0ZBeaO9y2YWU+a X-Received: by 2002:a63:cc53:0:b0:372:7d69:49fb with SMTP id q19-20020a63cc53000000b003727d6949fbmr42287825pgi.21.1653766620248; Sat, 28 May 2022 12:37:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653766620; cv=none; d=google.com; s=arc-20160816; b=vIrsv1rSbUUmPpMLEqc/ehXvlJIEhJfKpENmnZUwd8KY+V4e5FUIcaYoQX4EVoPsQy DSv+OCvgaTxpoVpdJemF0F9HVns5mGiwOqsiJPBUQU+1Igxilmvja8zpLQitrSF06h4F sqV5OjnVYmfNAiTCWumDALyvHwrA86RAn380pR2n/6T+ORe0o8CYe7P3+W2/l2XhVPqc SkZdc4xqh+diZ7QBtmshM4klLrpzh/KUGejG1oNNysMzqvsV4+Vmv2pmffIy34i1X6wA giiOtiM1aKnEtH3EcZhGJslDy3vV1Zj8WtejXn/Gqwj9H8ewN6FFwXcG4MpzcXXbA3N7 0KmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=UMz9LCyIv0m30eh3FGloydl9++TbxXfi01/dk2oD810=; b=YbbiEEz2V0/y45QVrtd6TxH6bm+eB5hV4qV4fm/loxtVbqXb0vx03FwsptxPk9iQ0Z zvJSWalD9dDHryAXWYe04gxMkc0IhlCvpZw3oWQIxHj+rKXBTQVnEMrL0cEklvMHNhQt J3XW27zQBpADBXrcbYxkifCLcnVRJCAyuWurXtnsLuvvrOeCdV73WSTuHEcqlKjCBwfH G5bgr0HSB1ODw1QMS6wvjLOiaTNzZ1bQdQ14E1zxdV50iBPn8tgY1hMwKy8iHYuBHRUm w7r9U1nuiN5onREwxa3FYEWI/4Lz0bnmY9HncBi1VoS58O7OIw+v5SKChQEoSVBvNWTE WzUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=B8tPUE5h; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id g37-20020a632025000000b003ab5ca8562csi11663733pgg.337.2022.05.28.12.36.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 May 2022 12:37:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=B8tPUE5h; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3177A5B3D8; Sat, 28 May 2022 12:02:20 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347747AbiEZPF4 (ORCPT + 99 others); Thu, 26 May 2022 11:05:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244390AbiEZPFy (ORCPT ); Thu, 26 May 2022 11:05:54 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6D856A42C for ; Thu, 26 May 2022 08:05:53 -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 ams.source.kernel.org (Postfix) with ESMTPS id 714D7B8205B for ; Thu, 26 May 2022 15:05:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D498DC34116; Thu, 26 May 2022 15:05:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653577551; bh=R/xetRo6lVmcMiToOdjleSOMxxio0iPr51IL0BL22C4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=B8tPUE5hJeB9nV+6Tvo/pt8JM+UbTjGy/Y9bAZaDDxls+VbvDvpxDhzFnQgXQNsZ+ XCDaS4POyir4RDlztRSHIFPdTYi/FTgSDl5yhNas40jizW2L2bYH9edZ3dAstKOzpu ATF4sgAdBCelmQ1xV8lXcGC4UT1eViMgYLeQO+n7PxS3P4nMg22oYs5eQXrDIDH0Kx fhJDopFm5oEJ+hKB8VH4rh3ev6cuGhEj6lIRrcDIK9jhP00zmFPzF2cmQ8jJuFDFUp +/xGSXOYLuD7qCKgAeNs5GE9ywWgAhUM1mrF3uGXz//prSuNd9LNAvYKx/aaNzFxu1 AjrZ68Nqrvedw== Date: Thu, 26 May 2022 08:05:49 -0700 From: Josh Poimboeuf To: Peter Zijlstra Cc: x86@kernel.org, jpoimboe@redhat.com, linux-kernel@vger.kernel.org, elver@google.com, jbaron@akamai.com, rostedt@goodmis.org, ardb@kernel.org, mark.rutland@arm.com Subject: Re: [PATCH 2/7] objtool: Extend UNWIND_HINT based ENDBR rules Message-ID: <20220526150549.vqvggcuqmw2baslp@treble> References: <20220526105252.440440893@infradead.org> <20220526105957.817269865@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220526105957.817269865@infradead.org> X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Thu, May 26, 2022 at 12:52:54PM +0200, Peter Zijlstra wrote: > Extend the UNWIND hint driven rules for ENDBR placement. Currently > objtool expects an ENDBR at any UNWINT_HINT_IRET_REGS that is at +0 of > an STB_GLOBAL symbol, with the expectation that this is an exception > entry point. > > Extend this to also expect ENDBR at UNWIND_HINT_EMPTY at +0 for > STB_GLOBAL symbols, with the expectation that these are also machine > entry points (SYSCALL et. al.). > > This guarantees all machine entry points are covered by objtool rules at > the expense of a few additional false positives: > > vmlinux.o: warning: objtool: startup_64+0x0: UNWIND_HINT_EMPTY without ENDBR > vmlinux.o: warning: objtool: start_cpu0+0x0: UNWIND_HINT_EMPTY without ENDBR > > Signed-off-by: Peter Zijlstra (Intel) I can't remember if this was my bright idea, but it feels kind of arbitrary. Hopefully there won't be a lot of false positives. Anyway, won't SYSCALL-type symbols typically be referenced elsewhere in the kernel and thus be found by the regular IBT validation? Do you have any examples of where this warning would trigger if there were a missing ENDBR? -- Josh