From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) (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 28F4624DD15 for ; Mon, 10 Aug 2026 13:35:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.198 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786368945; cv=none; b=bvbDBNFOFeWVAQq5WjpczFydbj5NQI25st/PrF8F4ButxmL5KI5/LCx6RBUiA4aSRGk7bUOJZdWySm1xJOzMG0BmpDbK+OKWcKxLJoduNLZGQFXt1hTFWkHzfBiafbZqRDnoqcH6oXcjb2XudcaG6cHLldNTL+JgKgYPqMewymo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786368945; c=relaxed/simple; bh=ERsyZ9sZLzOVP7R6tAaCm5UQsdEmR1MNZhZ8JlYPlxE=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=F68LpNOaD9nBo1HyigGYMsxS3r++cM5+8P1K1cwsdB4NHT9bk0Tb8MtqFwVk3N0Nc5lK/dd8DfE4+2ZNOUBBYkYUJwJ1wCOVn1GjbGGhvbzV0T1MRYPy29zFrkOGZESwweNpn84S9SpUwH4emorsmqNSGgcIUs23TnfM4FBelg4= 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=heMKCL9C; arc=none smtp.client-ip=209.85.210.198 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="heMKCL9C" Received: by mail-pf1-f198.google.com with SMTP id d2e1a72fcca58-84e13b57b2cso2577569b3a.1 for ; Mon, 10 Aug 2026 06:35:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1786368943; x=1786973743; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=HXpwDS64ztWP/hp11+tNqbM2bLIJJ6CzSe5TtwpRSOg=; b=heMKCL9CaN4a/LIE+gyetMn8s7TE8A27xQDevQF4ZR54E4RCkrkjGsf3KZ3RQWDq/2 /zFEZ2CYYs4Vde5+nF4mUhJmXuOn93jjgsGHIlM4+Cjy3vMk0Akq8v8ge0IONeO71RoH DSbF6BAX9eH297jFGt+MguqRbLJ5pD5vGJ0u+CUs/c2di5FUu4ZOVMMweh7jPQcHInLC vyoI57oa0QU1v7WH5paC1bYQ8zFfn8g9TDaCqqUfMUYK0jKOTuJRZvC/e4RtBPEY/YWF q72O4Y4y9SLx0LaYspsJ2HHDOcEju6y+/k+q9eRd2Sjg6+tLFMJ2kN5WbOvxR9/NEf5A FyiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786368943; x=1786973743; h=content-type: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:content-type; bh=HXpwDS64ztWP/hp11+tNqbM2bLIJJ6CzSe5TtwpRSOg=; b=o3BUyKmwIHcyl67vNo/FSHVkuUB/ciQa3pG4gZ1or49y40hEPHupKe1oIT1RsjUAhG 9M5CHkZrKd264nNRNtDfokm9iWBgCGZyMYr1KMUWFacFYwPykSrtOQ3p9LzEAqx+HoHI B0V7tWz9UxdKyx1Oz2u7h8XMt+0zor4adZvkVC3om7mgjqFMV86oN9xH7CDnugVys1Sk dp5UELR+ENIh/xLalB1/MGf0w/4fPZCZJRs1w19wVD330FKp4FlmvFjwNAmqYj6l3GOM TOShVoVkDLMCQhyN3b1eIxoCGzgtMhyy2YZrC7uHE5UcHE999tqaKQIqhJjNNbakKmxI 9mWg== X-Forwarded-Encrypted: i=1; AHgh+RpC3QKwSRYPKUKU6y94kEDmJZOxuCcJlinO6w8iNqVdbKUa6WipvAo/Zy/Cr2tLx29FRThIHWab+9dKj2Q=@vger.kernel.org X-Gm-Message-State: AOJu0Yw6hn9FnM+mPBbN3RYoava6mT+3I1+M0qIN5tKVYC5nx+ZqRUHI lk2r5ObW5/JeliqpeAKiaqxuOhSdLiCgBePEjV5HbPpkpflADSjWtz9nkl/rRbDy9F+SjljuFLR 7ZgMdwA== X-Received: from pgmk1.prod.google.com ([2002:a63:5a41:0:b0:c8b:2706:11a7]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:178a:b0:845:e97d:447e with SMTP id d2e1a72fcca58-84f2e040170mr45969220b3a.26.1786368943178; Mon, 10 Aug 2026 06:35:43 -0700 (PDT) Date: Mon, 10 Aug 2026 06:35:40 -0700 In-Reply-To: <20260808081050.408657-1-gokul02k@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260808081050.408657-1-gokul02k@gmail.com> Message-ID: Subject: Re: [PATCH 0/2] KVM: selftests: Fix two VMs leaked on early returns From: Sean Christopherson To: Gokul K Cc: Paolo Bonzini , Shuah Khan , kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="us-ascii" On Sat, Aug 08, 2026, Gokul K wrote: > Two x86 selftests create a VM and then take an early return that skips the > kvm_vm_free() at the end of the function. > > Patch 1 is the plain-SEV path of sev_smoke_test(), which returns straight > out of the UCALL_DONE case instead of leaving the loop. The SEV-ES path > next to it breaks out and frees correctly. > > Patch 2 is nx_huge_pages_test, which returns as soon as it has confirmed > that disabling NX huge pages is denied without CAP_SYS_BOOT. This one is > not an unusual error path: nx_huge_pages_test.sh runs the test without > CAP_SYS_BOOT for any non-root user, so a normal run always takes it. > > Neither leak causes a failure today, since the process exits shortly > afterwards. They do mean those paths never exercise VM teardown. Eh, not really, they just exercise VM teardown at a different point in the processes' lifecycle.