Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp21236imi; Wed, 20 Jul 2022 16:05:55 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tZvBzGFQQGeB4ibidkg1rdgYWpz1C7j5IL2X4CCLGDS8t7Q31/9Di/D7wsUqqCTUlLEucX X-Received: by 2002:a05:6870:4586:b0:10d:2ec7:be6 with SMTP id y6-20020a056870458600b0010d2ec70be6mr3935465oao.7.1658358355544; Wed, 20 Jul 2022 16:05:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658358355; cv=none; d=google.com; s=arc-20160816; b=N5/Dqx8zOCo4d3dGdWY3TmTmLkEUdq3pMvE28/HsAX+iz+GALrhe96rrClD2hU9UhG VOUDlf3OrsaxT4TogCRsgUO9VsAoQdrwDamC+cOBtbfmoja9APBrY5oFYHkcoqhmukSF LDMUiFwR9HmekIFFImz9FwAyXMqzRPNRmdFMS/m7tVw30O/yZrbhhOa4kxqfvaUYUxb2 EChtCyv9EL3M//ob8PyW2cfHy0jZi8FecwoqG9Vg55telos9RjJ8xsfPfMIaWTfnUqjb vV93vy8QQhON2ByIvP2d+C0ISuFeGvgMMFhFjMRLlbFwi+P/nDNzTVopXluYeJlmIC7F qKsw== 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=aR0cvh9ssgJRWeekMFBLTi7SJcSVrDuUx9+NMXDO7JE=; b=FeG52icC9HDKe7to14qMKILj+smmfBGpMlRhrVviBWtEwRJJ5YOJYiFv0mBRDhpiyk hoOkmYfjzdvGqe6M4Iu41ut5pdomMwtSSIg/DdiP9EVrcR1UMVAojxa7eheVry/Sx73R QTq+EDxTt1pTR2hvQU0eGT+ZkNOSJvrLDT72tnNmt353Li3PSNCi6AaeE96RjRF6N6RB +2f0cQ0ToTKm6NF6VTlJ27g+JHgmIEVznx34JLvUPHTjGB4xyrZXAqgL1ojw6L2ruRK6 vEp/f+dpXIX7LDImX9cnm5iw3xyJgOo0tun0c0pTLwwWG86CB29+tb55q263gAH8BlhV g2Xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="MoyjKp/s"; 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 t14-20020a056870638e00b0010199a9dd87si250752oap.147.2022.07.20.16.05.42; Wed, 20 Jul 2022 16:05:55 -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="MoyjKp/s"; 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 S231316AbiGTW6R (ORCPT + 99 others); Wed, 20 Jul 2022 18:58:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231319AbiGTW6P (ORCPT ); Wed, 20 Jul 2022 18:58:15 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 877885D0CB for ; Wed, 20 Jul 2022 15:58:14 -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 0CD2AB8222E for ; Wed, 20 Jul 2022 22:58:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D2266C341C7; Wed, 20 Jul 2022 22:58:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658357891; bh=WoBWhzEzDatHigwAp7WW78AXxwNWlr9H/kMGmBGhukw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=MoyjKp/suhAMM1A1JhBCpFigwNBGijyP1YcVsHE0iYIlzVpGFyZIBVgaQg1p4+VdC 24qppGEdHlb0ejxjQvHdbGj9qeVeo89ja1JveZN0wHYLrsclNeS+dg47y1KOk3l6R7 7oHby2tB1/4C9ToxO8Cgx84Z24vgu9TjRwtuJlLhIYnqTxA6uJrfo7JS+gDXKkB4PW F/WJGqJiCHhU9HkTm0XmrhH6vQg1hut64+APTwaRIuRziOQ56P5FxbK8MKT19KHVOE YS1KYRI6mG7CDOhhGk3EXd0oKzA6d40BdJglL9oBBi5zc4jzk4284VsbyWTKn0YqG7 n79bsnumQsNfA== Date: Wed, 20 Jul 2022 15:58:09 -0700 From: Josh Poimboeuf To: Kees Cook Cc: Steven Rostedt , LKML , Thomas Gleixner , x86@kernel.org, Linus Torvalds , Tim Chen , Andrew Cooper , Pawan Gupta , Johannes Wikner , Alyssa Milburn , Jann Horn , "H.J. Lu" , Joao Moreira , Joseph Nuzman , Juergen Gross , "Peter Zijlstra (Intel)" , Masami Hiramatsu , Alexei Starovoitov , Daniel Borkmann Subject: Re: [PATCH] lkdtm: Keep the rodata test from causing retbleed WARNINGS Message-ID: <20220720225809.wtnlgvof6wi4owkq@treble> References: <20220720155507.4f904a58@gandalf.local.home> <202207201311.775CB068@keescook> <20220720225615.lrt7xnxv3trmiyc7@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220720225615.lrt7xnxv3trmiyc7@treble> X-Spam-Status: No, score=-7.8 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 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 Wed, Jul 20, 2022 at 03:56:18PM -0700, Josh Poimboeuf wrote: > On Wed, Jul 20, 2022 at 01:13:05PM -0700, Kees Cook wrote: > > On Wed, Jul 20, 2022 at 03:55:07PM -0400, Steven Rostedt wrote: > > > From: "Steven Rostedt (Google)" > > > > > > The rodata test checks if executable code in the .rodata section will not > > > execute. But this also means that fix ups that the return hook code does > > > will not be able to change this code at boot up, and this causes a > > > warning. > > > > > > By removing the RETHOOK_CFLAGS from the compilation of the rodata function > > > makes it hidden from objtool and it will not add its return hook into the > > > .returns section. This keeps the fix up code from trying and failing on > > > modifying the rodata return call. > > > > > > Link: https://lore.kernel.org/all/20220720125736.48164a14@gandalf.local.home/ > > > > > > Fixes: ee88d363d1561 ("x86,static_call: Use alternative RET encoding") > > > Signed-off-by: Steven Rostedt (Google) > > > > Yeah, this matches a portion of what was suggested: > > https://lore.kernel.org/lkml/20220713213133.455599-1-keescook@chromium.org/ > > > > But it still needed objtool fixes: > > https://lore.kernel.org/lkml/20220715032333.neywlazczbb35w3b@treble/ > > > > Perhaps objtool has already had patches landed for this? (Otherwise the > > patch you suggested would fail to build on x86 with rethunk support.) > > I send this patch out a few days ago, nobody picked it up yet: > > https://lkml.kernel.org/lkml/8ec0039712f252693049c70ed3891d39a2357112.1658155446.git.jpoimboe@kernel.org Actually Peter said he grabbed it and is planning to push it to -tip tomorrow. -- Josh