From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f202.google.com (mail-pg1-f202.google.com [209.85.215.202]) (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 1FA0B42089D for ; Mon, 6 Jul 2026 18:09:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783361359; cv=none; b=ZxnlXYpGvkceq3+Qkk9rfJtmIQPMq0tb2g1cmv43sPmjas0ERzgdMxn1zHmmc33ZpPKJuP0NBsmmBOafaRAwqhI7shvZH3r0kWHWZsuvM27PxNeUTHPLKHXUmyPJ/eIRg2VGe/fBZHLz5JHlGCbQeqsOIXEZ9omPFdH28ZjGk8Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783361359; c=relaxed/simple; bh=6dW+JAuxB4Bg0lJ9WN8fFkd4N5NZoe/+1w+Q139I7zY=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=KKQS0NSkBTmIA3h8KVHzHyIdVsWq54qjJrRVrwyKUHDx1Td+rVdgg4yPllnr547OcTj0yf8mYHO/vzsWYjRuoCw/t06324I9TsBEII6ftypdhDpAwdX0/kW/6FXPBWfSP9DUGGPpw+wbr1yzC6ihC74K5f0OoPhc7MJ1Tb/YsQk= 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=jEns6GX7; arc=none smtp.client-ip=209.85.215.202 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="jEns6GX7" Received: by mail-pg1-f202.google.com with SMTP id 41be03b00d2f7-c9fe2607511so4843916a12.3 for ; Mon, 06 Jul 2026 11:09:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1783361357; x=1783966157; 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=24Bm1f0CNkzkBDhc/3jVoVdYR2LedLwQS2n18W/er8A=; b=jEns6GX7g5F6PXLGe5c+ktjH/iti5wwIu1NoFWOP3ywdcq7aOs1Zt78m1bqikzft/A FQJjrmvTIWb04jAjouA/s6++yUXnTDXFhjOHFhKB47FOFbEvRuHRBCbVZ4TWCAiTJwUh yX1c9s2/f0cEPs85jDjImHrh0iirG/FbbJZEzmbRaW6KVdKCeYnULKelOc4c7v+h1Z+b +2KXYYlML/63cKEv/eHNrvuvDhAgea2Tt6zg1gYUQ2+B8/ja7pk8L85X3oqfZ1IFAHqa 0XB2llfleArthD8wRLR8+LHJnLP7ZOhBT2hUX3gt0BUFn6X10+KKmqa/CEbBNaaAZ/YC EhPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783361357; x=1783966157; 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=24Bm1f0CNkzkBDhc/3jVoVdYR2LedLwQS2n18W/er8A=; b=WUgojbgpiHHXQ7GdHgVWtesUGUDuuo9rGJjPrkN0Pk0g28mD06nZvLOj56zjxf2/kK SMMSMFvuNucKVSrJu6KqYLMLlbtO75BvYMj7e2aRC5tFG025a74zz9R0Q/E2vrfPsE1q AxdVJP8rQ1e+7UimUCcqWGnRbnpAG8eZwzCrhCb7xZtyGVBuRH4hGrmtyMOJRdh5wSmP 3kJxk/Rs3mg9JpS26020PaEZr7+A8hWg/ynwxAULZFL7vMXTRh8zzY2PdmJodmWnmSg5 m+kHllLklo+YsE07oYTne7Yp8wB9+XJ0Jf+rgdNRoeaG2zPVyHfUA1Pr258kMZzI4cyl KY4A== X-Forwarded-Encrypted: i=1; AHgh+Rpe2/ZIDSmkuxz83t6OW27t1zKKrzOYJeW07pHMbICABLd9n8y1wzdzda5DSTV3GOGG+gk=@vger.kernel.org X-Gm-Message-State: AOJu0Yyl84Ya7Kouua+/1ikcXFPKyVk5BThUWMUZUI+/Ye90ODTe/cCq cleeFwL79oTfMeNz8HHsskUpRcm7oIS7IcZ6ws49RqUcWZNFFvToqPjBIh3XjCEAJ6MQzk0fpWf nx6Vbtg== X-Received: from pgbz68.prod.google.com ([2002:a63:6547:0:b0:c96:8ff3:53b0]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a21:e8b:b0:3bf:6c05:ab with SMTP id adf61e73a8af0-3c08efea06dmr2045616637.58.1783361357431; Mon, 06 Jul 2026 11:09:17 -0700 (PDT) Date: Mon, 6 Jul 2026 11:09:16 -0700 In-Reply-To: Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260602-sev_snp_fixes-v3-0-24bfd3ae047c@meta.com> <20260602-sev_snp_fixes-v3-3-24bfd3ae047c@meta.com> Message-ID: Subject: Re: [PATCH v3 3/4] crypto: ccp: Fix possible deadlock in SEV init failure path From: Sean Christopherson To: Herbert Xu Cc: Atish Patra , Paolo Bonzini , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Tom Lendacky , Peter Gonda , Brijesh Singh , Youngjae Lee , Ashish Kalra , Michael Roth , John Allen , clm@meta.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, stable@vger.kernel.org, Atish Patra Content-Type: text/plain; charset="us-ascii" On Fri, Jul 03, 2026, Herbert Xu wrote: > On Tue, Jun 02, 2026 at 03:36:34PM -0700, Atish Patra wrote: > > From: Atish Patra > > > > __sev_platform_init_handle_init_ex_path() calls > > rmp_mark_pages_firmware() with locked=false while the parent > > function of init_ex_path already acquired the sev_cmd_mutex. > > In the case of an RMPUPDATE failure for any page after the first, the cleanup > > path would invoke reclaim pages which would result in a deadlock in > > sev_do_cmd. > > > > Pass locked=true to honor the lock status of the parent function. > > > > Fixes: 7364a6fbca45 ("crypto: ccp: Handle non-volatile INIT_EX data when SNP is enabled") > > > > Reported-by: Chris Mason > > Assisted-by: Claude:claude-opus-4-6 > > Fixes: 7364a6fbca45 ("crypto: ccp: Handle non-volatile INIT_EX data when SNP is enabled") > > Reviewed-by: Tom Lendacky > > Signed-off-by: Atish Patra > > --- > > drivers/crypto/ccp/sev-dev.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > Acked-by: Herbert Xu Want to take patches 3 and 4 through your tree? I'll grab 1 and 2; there's no dependency between the KVM changes and the crypto changes.