Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp5882387imw; Wed, 20 Jul 2022 14:45:17 -0700 (PDT) X-Google-Smtp-Source: AGRyM1svIJrBFsddSBWTrND5kwHAidqtzzNfrcdguhrf1BCKJYNhZcgUx7mgPVByBlGaJWXKlOMI X-Received: by 2002:a17:902:7795:b0:16c:b506:d41b with SMTP id o21-20020a170902779500b0016cb506d41bmr34635789pll.72.1658353517182; Wed, 20 Jul 2022 14:45:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658353517; cv=none; d=google.com; s=arc-20160816; b=CwwOP9z2o2xi3SpZNkWMAP9KuKLiXRnF5L50o1Atk1100YZzwfhAQUJlt23lNViVsK B0DjLLkOErkH4YSPAYm5JrD6Nhe/zXmZdN0M1JPpo46Fo/JEE12qqk/5qi4nqhkM803p PJr+rw9dFhhBccGYA97OcVFR4YGPYC6acKrKJwlZ1mUyrKZuAjVMci6wcOuh4XHWrpbQ APxf/sHzw3Vg2jMpSvn5jsT1XemyoNN3mOGZDp5aQVdQFWw0AgyTbDijItxC1IuJQFVL QKB5mCs+CrmLg3hdHxunGqgSv5eHg0aivioL1iJbnMazCUcl9XexGYwaEO+giBDcI9xT RP1A== 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=pBly/RcMnnqar2Q10nf85mwKMvO+4aD4A0MydXAxm1A=; b=IdJfORqFqIAim+j9Yq5Oy9NvTH7XVDE3lsxaX5BkZHWUQB3sYgSeZChbNYT55OVtga OHOd89MS2ygzUgrx2rVLot96BkvahCHBIujyqhB46Ef8x/4BsKnVylso1WLOAiPYZGWx iOu1v5IjwDCWczPK5X+eZ4DnWz/UVTtRBMC/WN/wCT7oUu82aTpH2+vjqMIsdSC7MioA bz7nkMMKOlabV/7mEgW85ZtSDxoa4PXab3MjKxYAqBW9WwQQzz1uPXiy8W1Z12PM6QLW mIyntkOVphaQT/ANYcYKe9HRPaUTlHJBN2ROJECtX9rTA5ghyC+EQQTJs5WgGsKYKIW2 Kocw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=huYq9eF2; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i18-20020a170902c95200b0016c30bffeccsi173831pla.212.2022.07.20.14.45.02; Wed, 20 Jul 2022 14:45:17 -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=@infradead.org header.s=casper.20170209 header.b=huYq9eF2; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229782AbiGTVgs (ORCPT + 99 others); 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> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE 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 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.