Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3409146rwd; Fri, 16 Jun 2023 17:35:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5VarV4DO7xxSGUV+jYIlKp3A4tjxK8Eo2ZTlJldErbr/N7mJ/hDQg5CpwQ+nthJtIrSoSv X-Received: by 2002:a05:6359:288:b0:129:c4ce:9634 with SMTP id ek8-20020a056359028800b00129c4ce9634mr986386rwb.10.1686962121346; Fri, 16 Jun 2023 17:35:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686962121; cv=none; d=google.com; s=arc-20160816; b=hj2yVsK5TOItwn2nY1YGJ0lLosKWVd+AHL04TsQrwZse33INAlMQNl35XGlxl4p8BU yumxnPVtkwbPk0EoM9DhqVX1RHHoKJUVVQqTVqE4CDOmUcwKC55XZgZVLVmdi23X1Tvc 7PYUrd7PDzPTMtC8yLENIqfLrwOlPTpORZgkOSmmnHz/HI7bSqqhfxN8oePHpwGYxmse wg0sGsh/knlWavBg/fwO9cvaDsPJxn79JhV28d63ReuJ7S5SpMt2u1xJ6NyxvON02xs/ p+zlO9h7SsL9aFAUVklLwz7u+RBI5w6rxLBDcLs3KmsiRuEH9aANLw5YTOQFTkkbnrzE YAaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=7mA8/+gVI/uxP4eDnGOq5iD8c5wr/uCZxwMQSNlOAN8=; b=qODEMRXNGczUMX9LIY2ou1B9kT++1U0U1dOyrihXy5/ukueYGma8U/XNHcVXPT/0v4 LcF9T7qTNE08e+wJjZOIs2qED8UHiMgpc7HOmHzZWNzm9ya+LDGp5YsKKM8PgjGpwrsH SPr7Mc8gTCQE8WRoLKN5GBzx/iYH8UWZHIzns2Yjbhr1OzdYDoxdWvg+zSDozjIC4Ney OIHoQBOPCHTALsk6oqD/5rncTVUyZEQ3UmnJDSHrbw3DBbH6LW76XqoVfm5RcKLEFl7w oL7wu13MqsctOwqVwAvGkSDAJLBsOvw4SoVwnWfN45+MX9RPBBaRnYjFmwK9NWZwcw+a PWlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=sHURqgBI; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h12-20020a056a00000c00b00666dfff4826si1760798pfk.322.2023.06.16.17.35.09; Fri, 16 Jun 2023 17:35:21 -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=@google.com header.s=20221208 header.b=sHURqgBI; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231912AbjFPXY6 (ORCPT + 99 others); Fri, 16 Jun 2023 19:24:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229585AbjFPXYz (ORCPT ); Fri, 16 Jun 2023 19:24:55 -0400 Received: from mail-qt1-x833.google.com (mail-qt1-x833.google.com [IPv6:2607:f8b0:4864:20::833]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C771D2119 for ; Fri, 16 Jun 2023 16:24:54 -0700 (PDT) Received: by mail-qt1-x833.google.com with SMTP id d75a77b69052e-3fde1a16c3bso1649171cf.2 for ; Fri, 16 Jun 2023 16:24:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1686957894; x=1689549894; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=7mA8/+gVI/uxP4eDnGOq5iD8c5wr/uCZxwMQSNlOAN8=; b=sHURqgBIzrJEhHWUVuaqXb8F/iRv3cXsxkyCBhBPibO6dLk4rbfm98rgPYlWNaFBQE EsUsOJGGbpLQxPT4fc5hN12Hlccw88jNkoJG/bVgLF92phStwz7Tii3cmwvNlSizFxsy a4j1+U8mfgIum1MaKY014grV5phRlboo4xKq8EFpbRgdmoiqW0iYYPItvoK8ikjPZcsU TlTPCJWEhosa/WtYflQiH6F1XoQfv+Gd3fHuuT8X6/Ip3ZKGRq4KlU2zKgqYl5EKtRVh PbET+obAgp7Hjzgbt0098xpPKrPMdMlb+M7UzyjuCkRYIItmePFm0lDUodaaiLmfw6JV 6nrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686957894; x=1689549894; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7mA8/+gVI/uxP4eDnGOq5iD8c5wr/uCZxwMQSNlOAN8=; b=GhNFC+Da7RNLUjwtA9Xvw2tSj0s7Fsq7deOPmU2kWhjF+gdp6TDbPCb3+9g3t0F1SG Ro0EG7OzHOU5EWJpNAq0ToceNGFp76MbIIpgY3N7Qjg72A4YMJWlq0ilYuzRf7CqXdvp QRPXTm+CYNhdi11GTSHb6oSitBa60mDN+b+CSYXu0Yyd/nk+SWFzvAPIJWBJD91quMcy 8jylUHyWcweb2qnUhm1L6h14bYK9LQvAwDMBnd5w8MsODTxWyWtTfG77lJRGrH5DpEJB Lqo1nAXmMj3a3WoPtkyJal7jRixaQpD/dakzX1kBvykKz/A9BM0EqjVt6Xxv4IdgavW7 4F8A== X-Gm-Message-State: AC+VfDwW9zs9rFtNiCEcsdxKN8PBa7uarloBMQDuLOsS6UOyM/eXa13B PNS4SJdx8iGRgNeouVxFn1h75KVmsmoFzuvvUYDoViJprdXmxrlN1OM= X-Received: by 2002:a05:6214:301e:b0:625:af4b:415a with SMTP id ke30-20020a056214301e00b00625af4b415amr3407900qvb.19.1686957893796; Fri, 16 Jun 2023 16:24:53 -0700 (PDT) MIME-Version: 1.0 References: <20230615193546.949657149@infradead.org> In-Reply-To: <20230615193546.949657149@infradead.org> From: Sami Tolvanen Date: Fri, 16 Jun 2023 16:24:17 -0700 Message-ID: Subject: Re: [PATCH 0/2] x86/cfi: Fix FineIBT To: Peter Zijlstra Cc: x86@kernel.org, alyssa.milburn@linux.intel.com, linux-kernel@vger.kernel.org, keescook@chromium.org, jpoimboe@kernel.org, joao@overdrivepizza.com, tim.c.chen@linux.intel.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 Thu, Jun 15, 2023 at 12:40=E2=80=AFPM Peter Zijlstra wrote: > > Hi! > > Alyssa reported a FineIBT issue; these patches sort that. > > Basically the morale of the story is that CALL_NOSPEC and JMP_NOSPEC are > suspect and likely not what you want. The remaining users are: > > arch/x86/crypto/crc32c-pcl-intel-asm_64.S: JMP_NOSPEC bufp > > This is broken on anything IBT afaict. > > arch/x86/include/asm/mshyperv.h: CALL_NOSPEC > arch/x86/include/asm/mshyperv.h: __asm__ __volatile__(CALL_NOSPEC > arch/x86/include/asm/mshyperv.h: __asm__ __volatile__(CALL= _NOSPEC > arch/x86/include/asm/mshyperv.h: __asm__ __volatile__ (CAL= L_NOSPEC > arch/x86/include/asm/mshyperv.h: CALL= _NOSPEC > arch/x86/include/asm/mshyperv.h: __asm__ __volatile__ (CAL= L_NOSPEC > arch/x86/include/asm/xen/hypercall.h: asm volatile(CALL_NOSPEC > > These are hypercalls and supposedly the targets are having ENDBR on. > > arch/x86/kernel/ftrace_64.S: CALL_NOSPEC r8 > > The thing is !DYNAMIC_FTRACE only, which we can fix with a Kconfig > dependency I suppose. > > arch/x86/kvm/emulate.c: asm("push %[flags]; popf; " CALL_NOSPEC > arch/x86/kvm/emulate.c: asm("push %[flags]; popf; " CALL_NOSPEC " ; pushf= ; pop %[flags]\n" > > calls into the magic fastop stuff and should be ok, those have explicit > ENDBR + IBT_NOSEAL() annotations. > > arch/x86/kvm/vmx/vmenter.S: VMX_DO_EVENT_IRQOFF CALL_NOSPEC _ASM_ARG1 > > calls the IDT vectors manually, so should be ok (gross, but not broken > from this pov). > > arch/x86/platform/efi/efi_stub_64.S: CALL_NOSPEC rdi > > effectively a nocfi call, so should be ok. Thanks, this looks good to me. For the series: Reviewed-by: Sami Tolvanen Sami