Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3907465imw; Mon, 18 Jul 2022 17:12:51 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tHGSIkbMSBTxpBiZ7vseGeVVKoiwLNVNAWMCyUNQpTmVJxGO/6btTaU8T064E77LAD25uM X-Received: by 2002:a17:906:8a4d:b0:72b:6b8d:3779 with SMTP id gx13-20020a1709068a4d00b0072b6b8d3779mr28338222ejc.759.1658189571014; Mon, 18 Jul 2022 17:12:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658189571; cv=none; d=google.com; s=arc-20160816; b=Q5jBrhyO5MbckH7jK2AVe3ApnpVkCMeM/zec75i5B6F+H5jutEHo/OnfqcVaYFv3o0 AYW29YdAU/qtweAzGJ84px2wmQniFQc3JKmo2DCBAvXPVeI91Pc7HxUsidg79MYufyPO PR8Wf88KI6SMZyYxaRqE9JHP3mdP7FvjugZRCP5lSGcqFpa5tV/G3tQjG3TaksnZtcU8 qjtILMBvS+W1AMCPT26shwL6Y8T8KzmyQGwhj52b2iLLh40itDRawPqh05syOAACpQy6 oudT85cvC/rlWRqVlWGqPNF5aTWC5rDznUpdDpKMpWMrtJ1FZu/cHZRMc7DNChIt7XEV kfIQ== 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=a+cot110De+UzG3wtW+Sy/wDH7YJ9KM5/a2EnekXAdA=; b=vjR70K0L5f6u7EvHt7Q6g8Ozxi21P47v+KRvQre0PIdxQoOQbPuPm5U9T6sbZqzR5X v+nfuvfkmPg46zY2ZA/tgNBVK3N+tuTKFnHm8IufAfBFbagi6drw769TXUEmJl4+zN0I 1gJo8SzR7wrshh/hmtmtReX+SzCgrBnMsO0CSG7WNgvcSL5Hd4vIcaPyb9UaTPrZeGsA iq22ZGHEXJA6S2hxQOmNUnsrHyX7csAqF2vgkuoACimauRKCv+PUvpEk03HGl6qZKRYH JqsnDVEHn9g+kS9Lz0tTB8O1e1/v+delKdMPPaaWYkRKoYePGBhNDvHQ9HO0tGmUpOmf O+Cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=cnBODFpp; 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 dm19-20020a170907949300b0072f36fddba7si5473613ejc.812.2022.07.18.17.12.25; Mon, 18 Jul 2022 17:12:50 -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=cnBODFpp; 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 S231264AbiGSAIW (ORCPT + 99 others); Mon, 18 Jul 2022 20:08:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236140AbiGSAIU (ORCPT ); Mon, 18 Jul 2022 20:08:20 -0400 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4447532D83 for ; Mon, 18 Jul 2022 17:08:18 -0700 (PDT) Received: by mail-ed1-x52c.google.com with SMTP id w12so17462805edd.13 for ; Mon, 18 Jul 2022 17:08:18 -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=a+cot110De+UzG3wtW+Sy/wDH7YJ9KM5/a2EnekXAdA=; b=cnBODFppPN/QvytnTP/lRKnwByklCxNj/EX3D6zURE6vFkzZTEi+ZSCE3JvX/E75gX Ft/sJfCxXwc3LbvLSdi6LsjVl26SpqCXat727Jk5pfwbdOvF8oPbkt5ZfJ0lwJ7XqrXR LsgzqxgQQxn1h00DrWAKZRocBut9YdbKL+cp4= 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=a+cot110De+UzG3wtW+Sy/wDH7YJ9KM5/a2EnekXAdA=; b=PiAqil+6CurhFAMvsPesONWJcqxJnpP5wL0euy1bAdkQhZ5URYMmQByZFAYj9M7RyU wRAaQMGw31y0XiKml/MeLXTEkNvKyNyH85GmI7DExZ7ET/ZcG9D1KOPLmnvuOB6Gggdd X+MM1BlAVhcN72A1eAmHKrT6CgjRL2htgFMNNgDYk0rSpPyMY10QoB6fTo1cG0hYmked JM2qlf3oXKTtehwVNxrnAfPYXT3YyHlIeLbx8EYP5Qbh6bMgZzcfQU1p519mX2naSizy bI1zhsHDek7NgDQQkT1eSxCFCFSvZlR9b14/KQnfUEbHd6mcBQOYYaxPeweqCTKCjJCM E8mQ== X-Gm-Message-State: AJIora+7RGRjeARvLMQV2Oel1zmRuHQIa17M/Odmhv+Dh1BY2qip1zRE oJBogGWWSyUUqMW0Rgb/tWGSd0fb/bHrJWNZcSk= X-Received: by 2002:a05:6402:2936:b0:43a:711c:7c9b with SMTP id ee54-20020a056402293600b0043a711c7c9bmr41267600edb.144.1658189296568; Mon, 18 Jul 2022 17:08:16 -0700 (PDT) Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com. [209.85.128.53]) by smtp.gmail.com with ESMTPSA id 17-20020a170906201100b00722e0b1fa8esm5987387ejo.164.2022.07.18.17.08.15 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 Jul 2022 17:08:16 -0700 (PDT) Received: by mail-wm1-f53.google.com with SMTP id u14-20020a05600c00ce00b003a323062569so41255wmm.4 for ; Mon, 18 Jul 2022 17:08:15 -0700 (PDT) X-Received: by 2002:a05:600c:4ec9:b0:3a2:e9bd:fcd9 with SMTP id g9-20020a05600c4ec900b003a2e9bdfcd9mr35068586wmq.154.1658188924208; Mon, 18 Jul 2022 17:02:04 -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: From: Linus Torvalds Date: Mon, 18 Jul 2022 17:01:48 -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:52 PM Linus Torvalds wrote: > > Honestly, I think that would be a better model - yes, you lose 8 bits > of hash, but considering that apparently the current KCFI code > *guarantees* that the hash pattern will exist even outside the actual > target pattern, Gaah, I'm being stupid,. You still get the value collision, since the int3 byte pattern would just be part of the compare pattern. You'd have to use some multi-instruction compare to avoid having the pattern in the instruction stream. Probably with another register. Like movl -FIXED_OFFSET(%eax),%rdx addl $ANTI_PATTERN,%rdx je ok so that the "compare" wouldn't use the same pattern value, but be an add with the negated pattern value instead. The extra instruction is likely less of a problem than the extra register used. Linus