From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f201.google.com (mail-pg1-f201.google.com [209.85.215.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1EDDF3B777C for ; Thu, 12 Mar 2026 16:03:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773331394; cv=none; b=F7GNnQzxURALm8W3gMKw9pnuTkT+q1nYcj/LvyzrKhT4K8cEBi0nbHpWOMpSF8DrfSjHvkReutPuh/M261zKpfgZvARDwrNVsm2bUJadMRv2bQLKNXCyWhJdmx0Zf9f9XZYdT+n0/Xck1BwZSJNDiiSqJ0xJ1VYtj44npU89XOc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773331394; c=relaxed/simple; bh=+YVrai6jmlJOn4dLtUQsmll+LaXBC9VxjqzGvJUs3d8=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=iWsHjZaePrwVB1VLg7cRtpp9ZCDPLmuFQh4D7Xi1sRjeibt8fOXYZooe9TsK+qSdqwfMOjO8eXKb3L/HnXNkzJ1FrMAGM8jyVP2dUyNnXI7EqiUMWZtY5Ec9zDWPlP1VgxtPVNE3r7rOFHHRsuxJkQhCLrbErpvmIuXOotz21tI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=pGsko/Rg; arc=none smtp.client-ip=209.85.215.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="pGsko/Rg" Received: by mail-pg1-f201.google.com with SMTP id 41be03b00d2f7-c73b0c33e72so620898a12.0 for ; Thu, 12 Mar 2026 09:03:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1773331392; x=1773936192; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=IKfhHHHxcHNtHeFXvVtQ4riJbH3ZtNiRh2K53JPW2kk=; b=pGsko/RgrOFoCgEEQjiRD2CP4e8Jm0y88qieqb+Vnzkj5/PHoMKnntJb9AzdNs9HMr 1xD2AQaYSLoA1SevFB4UX1utqzRy2z3kfon02ij4DU7CZNGaX/nZybYaOUUC5bcHw9+o S3SjzzW7SqbAhZXEqYqcn4U+c0WJKBIjtoZ9OoR6PZrHtklOi/uvs10Mz0anAmm5hctv qaXH/2oV4dyQlEmFayBCRftomvnUxIhjB4oXzh3cZsg/B/BJBc2APal/OJoFvxjR49E+ +VhrFq1PhpWHhXUApAmrE7+OLXuQ+sUS3Q2sAS8zjfBH92GkwGaFPtRJfz23PuBUhvLB J6Ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773331392; x=1773936192; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=IKfhHHHxcHNtHeFXvVtQ4riJbH3ZtNiRh2K53JPW2kk=; b=I/hI3OdD2XGYDWunU5DILwwsnMRSNAHvgrhNq3n09y3p5FxZ5GLw39BZ0bNDwzWYRf aF/RyknNX4lCQkX09bVN1Jc0GJh8YsQo0YHhKbGe68We8rr2qBoibRzkMUf2Cz/5Qtx2 jEteZXqQAcu8/3tLf6V8e03RPCsRe+AiWcTs6GSzGgNq8YpAp/MaIuL+K2M59vDcgqBh grFIKiJz6o+8gT+mTfhRzqHMI146ba3N+zUnsLEPGL0MCCyFpSPPJ+gkMXc+ccLep9HV 6i0LO0m+KNYHgb37D81gA5umR1Mn629aHJVp5cNlVNeRMOsawkbqWOodLJ8F28l31Ln8 /USA== X-Forwarded-Encrypted: i=1; AJvYcCU7FUmL1o32JCGW7t4VbEerM0cqtSaqKiFwV8lyETKRWOebUNE68JHkIZmmvCyyBpo7Xinf4mpYPlNGpRg=@vger.kernel.org X-Gm-Message-State: AOJu0YxsKis0nvNsMPSjeb0LD05BAEHZqudXapZDhMXpiQidw3lkuLeZ 7JtZqFExc6/nDzQJz96yO1aBo7tzMsW1p+6E5/4l0agpuFku7WkqOb1rnSHiZGtKJD5+M4uLUL/ qlTF7NA== X-Received: from pgkg10.prod.google.com ([2002:a63:fa4a:0:b0:c73:cc95:c0e6]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a21:2e14:b0:398:9ea8:9454 with SMTP id adf61e73a8af0-398c617eedbmr6087154637.71.1773331391841; Thu, 12 Mar 2026 09:03:11 -0700 (PDT) Date: Thu, 12 Mar 2026 09:03:10 -0700 In-Reply-To: <08c7e1fa-c78f-4c6b-b2cb-baf7233e681d@fortanix.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260310234829.2608037-1-seanjc@google.com> <08c7e1fa-c78f-4c6b-b2cb-baf7233e681d@fortanix.com> Message-ID: Subject: Re: [PATCH 00/21] Fixes and lock cleanup+hardening From: Sean Christopherson To: Jethro Beekman Cc: Paolo Bonzini , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Alexander Potapenko , "Carlos =?utf-8?B?TMOzcGV6?=" Content-Type: text/plain; charset="us-ascii" On Wed, Mar 11, 2026, Jethro Beekman wrote: > On 2026-03-11 00:48, Sean Christopherson wrote: > > Fix several fatal SEV bugs, then clean up the SEV+ APIs to either document > > that they are safe to query outside of kvm->lock, or to use lockdep-protected > > version. The sev_mem_enc_register_region() goof is at least the second bug > > we've had related to checking for an SEV guest outside of kvm->lock, and in > > general it's nearly impossible to just "eyeball" the safety of KVM's usage. > > > > I included Carlos' guard() cleanups here to avoid annoying conflicts (well, > > to solve them now instead of when applying). > > I wrote a bunch of tests (see below) to check the kernel can properly handle bad userspace flows. I haven't had the chance to test them with your patch set. > > test_vcpu_hotplug() triggers dump_vmcb() FWIW, this is a non-issue, especially since SEV-ES+ guests can effectively fuzz the VMSA at will.