From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B002CC43334 for ; Wed, 20 Jul 2022 21:36:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229963AbiGTVgs (ORCPT ); Wed, 20 Jul 2022 17:36:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229532AbiGTVgq (ORCPT ); Wed, 20 Jul 2022 17:36:46 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F6331F2C5 for ; Wed, 20 Jul 2022 14:36:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=pBly/RcMnnqar2Q10nf85mwKMvO+4aD4A0MydXAxm1A=; b=huYq9eF2cD7yraAZoWOnmj2JK1 ceavaMLgJcDAuNsxb8KZIwh8oGtfOZYvU+haSjR7OuBUWbKZ4bDu2APQGKsxYUVkKwwXvuTVg+nDX Jxn06L5jj8NZEy0hPF2yGhHlFFihJG6xGveEVIYPKLarQXIKXjsyqNJ+BuZsyM8dUV3JY9SsMc6S3 biTOMMKSNXqqIzWNNeAaZKclkyERicyqBEFaXbUmRZC9H5UfYlRdnXE14AZVyCLF8qeaw4E7xUr9V CgY8T4CqaK2k4omm6B3NVHaT/wVUYl9qDTwfsar7NOdNEELfgJLVwRQgHYBcnK75nbZH0xgLnPOSP cbz6Ik1g==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=worktop.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1oEHMY-00EoaY-3e; Wed, 20 Jul 2022 21:36:10 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id D3F26980BBE; Wed, 20 Jul 2022 23:36:08 +0200 (CEST) Date: Wed, 20 Jul 2022 23:36:08 +0200 From: Peter Zijlstra To: Kees Cook Cc: Linus Torvalds , Steven Rostedt , Thomas Gleixner , LKML , the arch/x86 maintainers , Tim Chen , Josh Poimboeuf , Andrew Cooper , Pawan Gupta , Johannes Wikner , Alyssa Milburn , Jann Horn , "H.J. Lu" , Joao Moreira , Joseph Nuzman , Juergen Gross , Masami Hiramatsu , Alexei Starovoitov , Daniel Borkmann Subject: Re: [patch 00/38] x86/retbleed: Call depth tracking mitigation Message-ID: References: <20220716230344.239749011@linutronix.de> <20220720125736.48164a14@gandalf.local.home> <20220720135016.3178ffc6@gandalf.local.home> <202207201219.8EA905372@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202207201219.8EA905372@keescook> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 20, 2022 at 12:36:38PM -0700, Kees Cook wrote: > On Wed, Jul 20, 2022 at 11:07:26AM -0700, Linus Torvalds wrote: > > On Wed, Jul 20, 2022 at 10:50 AM Steven Rostedt wrote: > > > > > > [ 2.464117] missing return thunk: lkdtm_rodata_do_nothing+0x0/0x8-lkdtm_rodata_do_nothing+0x5/0x8: e9 00 00 00 00 > > > > Well, that looks like a "jmp" instruction that has never been relocated. > > Peter, Josh, and I drilled down into this recently[1] and discussed > some solutions[2]. > > This test is doing what's expected: it needed an arch-agnostic way to do > a "return", and when the way to do that changed, it also changed (which > would normally be good, but in this case broke it). It's been happily > being used as part of the per-section architectural behavior testing[3] > of execution-vs-expected-memory-permissions for quite a long while now. > > I'd rather not remove it (or do it dynamically) since the point is to > test what has been generated by the toolchain/build process and stuffed > into the .rodata section. i.e. making sure gadgets there can't be > executed, that the boot-time section permission-setting works correctly, > etc. Before the retbleed mitigation, this test worked for all > architectures; I'd hate to regress it. :( > > -Kees > > [1] https://lore.kernel.org/lkml/Ys66hwtFcGbYmoiZ@hirez.programming.kicks-ass.net/ > [2] https://lore.kernel.org/lkml/20220713213133.455599-1-keescook@chromium.org/ > [3] e.g. https://linux.kernelci.org/test/plan/id/62d61ee8ef31e0f0faa39bff/ Josh posted this: https://lkml.kernel.org/r/8ec0039712f252693049c70ed3891d39a2357112.1658155446.git.jpoimboe@kernel.org which I picked up today; barring robot fail I'll push it to x86/urgent tomorrow.