Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp21427imi; Wed, 20 Jul 2022 16:06:09 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sF43eXsFrVLz+uDiueKo2kQ26n+7wpM/2cr+X3WzJbvhm4GCE4JK4Rn5gnfSBmz/czldFv X-Received: by 2002:a17:902:f70d:b0:16c:50a2:78d1 with SMTP id h13-20020a170902f70d00b0016c50a278d1mr40205413plo.34.1658358369594; Wed, 20 Jul 2022 16:06:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658358369; cv=none; d=google.com; s=arc-20160816; b=NhnHD1hUmumxb0oRekhWxK8UKP6zLt9UY3nsH5wuwKtNYPt51NvQzlpw1FtEM1HLlx muAl0UfgXK9dDBOPyVTg7c34t5E0GsD2A35bX75iGt0FZmMH6CdDrUojCdtYX/5yo/Kf YB+KsSO0OpI2E3k6orBC9yG/wp2Om8DVUiwwAfoy0PeE2ZnlQ+Fb8HOSKc7Yo6sGdWfF TtiZgD+QDMDOgrS2UGzhc8vFExeBSX1Drc1/EaJp3Vu/jp+sjs3sp4dNzK5ZZSeY94o+ dIsWL3qNXhrIN/iKNyRtwClfcG+djHRXcnEQH5Qa40LLjM33i/bhcotO1v1oPUW6QtRM 9JYQ== 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=JjS7ysHXp7xI3sGp/oGdmzOUGaByzl1KmQgbzqzKj6M=; b=Ysh26+gJI8wM4guAj9PYBbBoP9RsZe58c6cbKWQHBrYS1t6ewOqBnwzFpDBOvjfbQp 15dVqGhtDu/22NnX/q30WFhNVgNZgcf8Qwh70BSl8wMIUx6HnO1F2Q08YiXxB6v9yBR5 hvfooDUNIqejlbQcBulKyQBS7lNJLylXoDHc03w1ooQjP5OWOZWp5HnyLTgcgK8L77LI 98cfK4ZqVdJ7tkldd2CG2GEt2UCeRef9Qf00UOsdKbs6nloX6K5GL+LZkC6O42uvBAHl /SG+DvTvbFlSmG6lBz7O/QMZVz2XRYzrwfTiHUGstp8t6Ab4AbbLYfr7GVKYpk6KqSsX OIjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OJcW7DNt; 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 r130-20020a632b88000000b004152331e6a2si26420pgr.829.2022.07.20.16.05.54; Wed, 20 Jul 2022 16:06:09 -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=OJcW7DNt; 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 S231166AbiGTW4W (ORCPT + 99 others); Wed, 20 Jul 2022 18:56:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229853AbiGTW4U (ORCPT ); Wed, 20 Jul 2022 18:56:20 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3701F3A4BC for ; Wed, 20 Jul 2022 15:56:19 -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 B87D961DB6 for ; Wed, 20 Jul 2022 22:56:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5373EC3411E; Wed, 20 Jul 2022 22:56:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658357778; bh=8dTGHgoUmmraiZ1spyXCUCoGocjI1Alwr6lz2GkucJA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OJcW7DNtXUllj3k1KGoX0D+aayJDajJAt5Yl9dkACJHloHfxG0RilrrfGJK6cTNi/ y2vFHdZYd50iMW6cKqesENnChec+Sqo6LmFoT2PL1a6+XlR9Fm0Ud4F1smzMq7pNUk A9PXw23FNEXpGCeR+i3p3a7Jd6SduTW/BJZaHOY1WSMTpdFSEINA2p6pIue5mUrIQU +OfueHiRTRMSmLP0Oq8q7J6jQXhePQDAYGVjRnwaRpgKnLLnwEVSREC3YiavrzW830 IZOgI9IdMC0L4ftdi12x2cS8kk+1tnzlfhqXiYBJcRwUhoYTeIBCLe7EE92I6qmAyX kDlW8L4C4tFnw== Date: Wed, 20 Jul 2022 15:56:15 -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: <20220720225615.lrt7xnxv3trmiyc7@treble> References: <20220720155507.4f904a58@gandalf.local.home> <202207201311.775CB068@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <202207201311.775CB068@keescook> 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 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 -- Josh