Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3905916imw; Mon, 18 Jul 2022 17:10:55 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sHVrEBcMZKTBisriw1VGvSq3AB8Sd06QznzrQdFruTNKdkl46JvfbeReTR1glubD0kQM3Z X-Received: by 2002:a17:907:c2a:b0:72b:8119:4da9 with SMTP id ga42-20020a1709070c2a00b0072b81194da9mr27235279ejc.746.1658189455040; Mon, 18 Jul 2022 17:10:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658189455; cv=none; d=google.com; s=arc-20160816; b=K5/XLijmj/XTbrN/uO4oc/IrT4YYNp8NsJ3l6F6WNhYgpUVS/dT6Dq1DuMot7fveaP b/7GKrPna4i9akm39dYv/ksaXwU70Ce1lCMHi4aMrF75K0vl2/I3uDhhi760iNzh5u6Y 1Vuf+3B9fiCc0SKiIjOtybZYTTVdA909POR0QQBypLOYf6uVS/Fz7d76Z1YTH0nD2lmO +7jDGL/hvUdKn/g9aLvyi+MKU3HOTjmOFDVXTprKtpZvdAIfuDyABCEMD5tGDmrCsXNE DyJzotLq2hsrO+0aDChkzqb6fC18+LXX08XhrvOZCT7avgMXZ6FIX3Hdm8OnpTLm092F MvHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=s2wWsHBzWaoHMXXFu8RTrRcffXzVK/Y99IpZoEKnNG0=; b=IJ4MWhtsK7MvP4hgM4IXYgx/OTyV1oTc3ncn75AAhUoZlezGbQvs3bHA1pYvsJTsLq /wequjIK0T/VFTau1omENcH6QrO5cGKzxg9b8SIll9h1/rQFFjbWRRzKpGNYpcWwHs5r NdfILoqrawJ+JtQ4XGjpOzE0vWdJmVNswxEi5aeMUG19t8Se3zFrXP4NhjNvOdpnuE/p dmjcizv6nsqNkxXTlzI9zzWCCNy+t7GmixgqrypMQRaLMdfq6a13OawzzqnKJ0xFEEfa QajluvXaHf2+9Wzhf+oa96BNLzUXULxY5rj+EhDpPc47fqE5BPFeJyj7PpGxLVOsMtpF ztkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=h7wyNYsX; 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 jz19-20020a170906bb1300b00722f52f1dd4si14197178ejb.809.2022.07.18.17.10.30; Mon, 18 Jul 2022 17:10: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=@linux-foundation.org header.s=google header.b=h7wyNYsX; 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 S234876AbiGRXmy (ORCPT + 99 others); Mon, 18 Jul 2022 19:42:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234888AbiGRXmx (ORCPT ); Mon, 18 Jul 2022 19:42:53 -0400 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F2E33244D for ; Mon, 18 Jul 2022 16:42:52 -0700 (PDT) Received: by mail-ej1-x62f.google.com with SMTP id ez10so24121114ejc.13 for ; Mon, 18 Jul 2022 16:42:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=s2wWsHBzWaoHMXXFu8RTrRcffXzVK/Y99IpZoEKnNG0=; b=h7wyNYsXSRuaLt0cfCGQ+xiqw67XsNzuawdivwWuxMtgMqdp2Dqhsw2k/QTIf7bqru WK0RiIY5eZXEJLpKIGNyMH/TE6LwhseEu7uPrBg83fCnNSIQKbI5ZUPi+QHnWVf6tph4 bFxha4ILzSHYlSUo9DCjQA9w3LHF8NnVGjQBg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=s2wWsHBzWaoHMXXFu8RTrRcffXzVK/Y99IpZoEKnNG0=; b=bGlISPuK1CyETqyD1RKI6IiOP8g7oslxhONlMSoTLzS2OjCWggVQEqc51tPjlU8Dj3 4ekA5RmS1egPoynDpr1akM5PBc8t6KOJ/BUhB6th3Xy0WKcZhgdXGaKbB2tmAEQAiOCn 7Fo81P/b2pLCZ2+JyrXNV78QQUH9K8aEl4GcZyc37GFackDt0+9CZDqyGJiea5eKZdMl ZqZdFtVIkfGt4AT8RXH0HnUjFQ61aIipvdm6Xqmyf7mKyPki2KHi1n90dR/xQF8lUnAF 1vdjEdMTaPOP2p/G3BGfb7C96gJ2HNnqJDVdym3xaLwIi53UJvxh9WposSgCnHk+K6m3 G6ug== X-Gm-Message-State: AJIora9p34e1GqFYVOwIGHnMRapXXAc3Cy+2z/wj/SIDreVe492KTHE5 19FjTfQbU/jZ32sNxg+SNcUQcx6RwYcli8462VY= X-Received: by 2002:a17:907:7f8e:b0:72f:11ec:f5f8 with SMTP id qk14-20020a1709077f8e00b0072f11ecf5f8mr13440428ejc.343.1658187770670; Mon, 18 Jul 2022 16:42:50 -0700 (PDT) Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com. [209.85.128.44]) by smtp.gmail.com with ESMTPSA id lb2-20020a170907784200b0072f2e409575sm2120686ejc.98.2022.07.18.16.42.46 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 Jul 2022 16:42:47 -0700 (PDT) Received: by mail-wm1-f44.google.com with SMTP id h14-20020a1ccc0e000000b0039eff745c53so8214752wmb.5 for ; Mon, 18 Jul 2022 16:42:46 -0700 (PDT) X-Received: by 2002:a05:600c:2211:b0:3a3:2149:88e1 with SMTP id z17-20020a05600c221100b003a3214988e1mr2129287wml.8.1658187765714; Mon, 18 Jul 2022 16:42:45 -0700 (PDT) MIME-Version: 1.0 References: <20220716230344.239749011@linutronix.de> <87wncauslw.ffs@tglx> <87tu7euska.ffs@tglx> <87o7xmup5t.ffs@tglx> <87lesqukm5.ffs@tglx> <2f7f899cb75b79b08b0662ff4d2cb877@overdrivepizza.com> <87fsiyuhyz.ffs@tglx> In-Reply-To: <87fsiyuhyz.ffs@tglx> From: Linus Torvalds Date: Mon, 18 Jul 2022 16:42:29 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [patch 00/38] x86/retbleed: Call depth tracking mitigation To: Thomas Gleixner Cc: Sami Tolvanen , Joao Moreira , Peter Zijlstra , LKML , "the arch/x86 maintainers" , Tim Chen , Josh Poimboeuf , "Cooper, Andrew" , Pawan Gupta , Johannes Wikner , Alyssa Milburn , Jann Horn , "H.J. Lu" , "Moreira, Joao" , "Nuzman, Joseph" , Steven Rostedt , "Gross, Jurgen" , Masami Hiramatsu , Alexei Starovoitov , Daniel Borkmann , Peter Collingbourne Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=no 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 Mon, Jul 18, 2022 at 4:19 PM Thomas Gleixner wrote: > > But that's an implementation detail, right? Whatever we put in between > will still be a fixed offset, no? It's a different offset, but that's > what patching can deal with. No, what Sami is sayin that because the "cmpl" *inside* the function that checks the hash value will have that same (valid) hash value encoded as part of it, then you actually have *two* valid markers with that hash value. You have the "real" marker before the function. But you also have the "false" marker that is part of the hash check that is *inside* the function. The "real marker + 6" points to the function head itself, and so is ok as a target (normal operation). The "false marker + 6" points to the "UD2", and so is *also* ok as a target (bad guy trying to mis-use the false marker gets trapped by UD2). Linus