Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3948543rwb; Tue, 16 Aug 2022 11:27:52 -0700 (PDT) X-Google-Smtp-Source: AA6agR4Bl972qDIC3OFSBo76VtZj+LWiMZBEOwuYYy8cSSgrUaWcX+Y8nDaXZedP5FrWo50cM+C0 X-Received: by 2002:a05:6402:4386:b0:43e:90b:6e44 with SMTP id o6-20020a056402438600b0043e090b6e44mr19664293edc.310.1660674472592; Tue, 16 Aug 2022 11:27:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660674472; cv=none; d=google.com; s=arc-20160816; b=J82EADP1uupFMqIEjn90ukmayokJw1Mn/hBDZZ0uOWTFzEUXbvcwKxIjBUHXkzc2Xu eUayfmw3KhmsfA4rI3NnrTSMbMvF15g4RRbQVOJT0eUpcCe2zofnj6iUcK0EnEYv9eCM nPWNEbGpUkltJc6hkJvXpVUFwTpBM5NOa8JfRbRVnCuctWUvhyRNkLJ11D4Qraj3bd39 9q51An7/uLWn9rZry/ZvwzIdiT99RjCZapQSkUiFQNoPcC2CV/J4QoLlPRWaiuuZ82Xe Sa9E+SOXS8WGyew+KucXOY/oXDLiYWnelBbh0Z1fHMCDcC5+sHQhz9qx6o8B+JmgfiuX cjvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:references:in-reply-to:subject:cc:to:from:date :dkim-signature; bh=TSjMr0/SAf5Byfzo8LZakevLLdvnLz7vcX1LJaoLVPo=; b=CGB85LP1RfHGV7W9sCSgfdVue1sF7HY7/QqZHOc98DxRN6c1dC9q4Dh617Vqn2c8pz k277yScmTi1ReNatm0Snd0sMJ6Eq5U/NQX9fYp+E0wDf5jgz4Dm+Lf7X7L72Ltl4sE5A TZDW+WlWBSCXJq3s8O9juMLtd1zPbqoy4ZRQLJyCtc1GoYaWkLAYyLrBY83J3dWg/sAo GATmxNZYdPBs5DiQNAcY7cHtMW17x4alsPQFBh9A3vwsHyKmNwIDkmgEpxHFNs1EsS4I c1BA5WNNsV+C0CWoZw2+5PiJwa+CymPgyYG7uEAL8LyMSNbpL/5gPCz8cxoH38st2HdC Ucew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=BUJZuj1F; 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=alien8.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gt6-20020a1709072d8600b007309efc29a4si15383463ejc.691.2022.08.16.11.27.26; Tue, 16 Aug 2022 11:27:52 -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=@alien8.de header.s=dkim header.b=BUJZuj1F; 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=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237025AbiHPSPO (ORCPT + 99 others); Tue, 16 Aug 2022 14:15:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236996AbiHPSPJ (ORCPT ); Tue, 16 Aug 2022 14:15:09 -0400 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3427E82FA8; Tue, 16 Aug 2022 11:15:07 -0700 (PDT) Received: from [127.0.0.1] (dynamic-089-204-137-236.89.204.137.pool.telefonica.de [89.204.137.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 730CC1EC01D4; Tue, 16 Aug 2022 20:15:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1660673701; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TSjMr0/SAf5Byfzo8LZakevLLdvnLz7vcX1LJaoLVPo=; b=BUJZuj1Fz7MQNDr8nVE3dnHvIefBxAAgD49dPyF+cNm2UMPfi5UAXw05ItAqI+RhcAAana sE33Pygi2lxG833JiFlCn4r847Xu8mRNUFrLrr5MUCUl4f4ciVdnGH5sc34lv2NLMTUk2t o4/32sPRGW57jVk0HPi1UPRg1Tj4mFg= Date: Tue, 16 Aug 2022 18:14:57 +0000 From: Boris Petkov To: Daniel Sneddon , Peter Zijlstra , Greg Kroah-Hartman CC: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Pawan Gupta , Andrew Cooper , Thomas Gleixner , Borislav Petkov , x86@kernel.org, Josh Poimboeuf Subject: Re: [PATCH] x86/nospec: Unwreck the RSB stuffing In-Reply-To: <84f4b1ea-d837-9a53-a21c-4ac602ff8e75@linux.intel.com> References: <20220809175513.345597655@linuxfoundation.org> <20220809175513.979067723@linuxfoundation.org> <839e2877-bb16-dbb5-d4da-bc611733c7e1@linux.intel.com> <84f4b1ea-d837-9a53-a21c-4ac602ff8e75@linux.intel.com> Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_SORBS_WEB,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 August 16, 2022 6:04:36 PM UTC, Daniel Sneddon wrote: >diff --git a/arch/x86/kernel/alternative=2Ec b/arch/x86/kernel/alternativ= e=2Ec >index 62f6b8b7c4a5=2E=2E5c476b37b3bc 100644 >--- a/arch/x86/kernel/alternative=2Ec >+++ b/arch/x86/kernel/alternative=2Ec >@@ -284,6 +284,9 @@ void __init_or_module noinline apply_alternatives(str= uct >alt_instr *start, > /* Mask away "NOT" flag bit for feature to test=2E */ > u16 feature =3D a->cpuid & ~ALTINSTR_FLAG_INV; I guess it is time for struct altinstr=2Eflags=2E I never liked this INV m= ask bit=2E=2E=2E > >+ if (feature =3D=3D X86_FEATURE_NEVER) >+ goto next; >+ > instr =3D (u8 *)&a->instr_offset + a->instr_offset; > replacement =3D (u8 *)&a->repl_offset + a->repl_offset; > BUG_ON(a->instrlen > sizeof(insn_buff)); > --=20 Sent from a small device: formatting sux and brevity is inevitable=2E