From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) (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 86E3D1A6814 for ; Fri, 7 Aug 2026 23:06:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.197 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786143976; cv=none; b=ZLvCuo19n6njTakmOF2p7Bnd1u1Mpy6C+1Gf4kgy1sRqooI8eQ6bLqLaA3g0VXK3xTzsHu0hF4cMMpBqiis8hk/tmip6r8ExfE5JX1c86QwZUH+ElXzqknE1PRSSh+57l110pabZTX+Oim5reRS02h+5SmYbHI7hWRmVpWKyRsE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786143976; c=relaxed/simple; bh=Ah7os4dPUnM7PXOAVjFiX82IffndnNTATTNU1WZd0JA=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=J96vO/xrs7+bmGJYsxHsshpl5YRMz7qWsHQw4rUCgdZ+3QvsgZ9lIZq60QWXF6yNmns8/1gzsoCCDe8FWish30XJo3lHkrn2NWevZAHSXLJfl+TrM+bQNrLZ/dwQGVOTrnKoF2WNBodmwTAC+/RfyAKXkGP9N5KReHHA0iRjxzI= 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=NdWgIA23; arc=none smtp.client-ip=209.85.210.197 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="NdWgIA23" Received: by mail-pf1-f197.google.com with SMTP id d2e1a72fcca58-848860def2cso68246b3a.2 for ; Fri, 07 Aug 2026 16:06:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1786143975; x=1786748775; 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=Yi54ty/2uOVISFFIV8GBz7xZ1AQ64miqFpO9VtjCRnI=; b=NdWgIA23pPjmpFYaabmXPdmBBIxw9entcOfgxkivCioLxg368CCj7L2zmlzf0lS4DT eKqXt3LybU7ydoCkk/PCO/xb8oMeUCeX8R4siORlESDdwYYUxKVP8GnL+fXWrtqjhcjx fQTONbt2NwhjEMrfVsvMS/WYRAz0hYUROcq/FZbC/RpHaFOypVf9q1YDgpbC/UujOf2x R4Ho2/VhrK8y50QZoYWVJV0fhivcYWVEx1+W/vxLuylb84tVIl7TEi8hz1+J8iYJbsy7 Mom+mL/4P8P4+71GRZfz65FyfaHFHO+XiRSVpPnvspIANWkRLhocEtm5aF6idsE3Rorh jO8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786143975; x=1786748775; 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=Yi54ty/2uOVISFFIV8GBz7xZ1AQ64miqFpO9VtjCRnI=; b=Lr5n1dp4zT6sjWSDvZI944bdWlswMxwi65/g1IXrCrnuPap/bs97BX1H5WBjWeNzu8 FDCFnkYU/7beETJ5fgfzd4aIl7Y/urO0BOQONVtjvuJSg9+ncsesUGr4coEh5TzwgZUC UXBcEqm0xMDPy05+E2y5H8OiKjQxswiEx8FxMAOaQJdMd+6JUJB77okcQcvbzK1cKNDC OvAzJ9PE3iphH0p50acJG6/rzsRSCe9qu2og4b/Ss/WEBWObt1N/psf3sGRW34sdI1v9 HXVXdGC+FfUglE4mf6DEpg+IpoujJ7/nKbuem9AXDixd5l2iIJGI3Gsh4oYfGk/T0bdw Qljw== X-Forwarded-Encrypted: i=1; AHgh+RqZZB0ria+MU73UYTq6oNj9B/sFLF55L+SBEXj2dofUqYC/SNHj26D3wK9e3LAiVtLhX7SfaaR6XK3A0wk=@vger.kernel.org X-Gm-Message-State: AOJu0Yxs/Nr8fWTb7OR5Afd2qhcO2htfAdNOl99D1AM0/vp5Q2rDKkgk I8v7Ha1bfxiiq1cnNkukbVAVtHWSggpvSm1sWEOi+jHy6kQfWjssX940gxZKNIL87EGLWc+D8Et mCZ8hTw== X-Received: from pfbfr12.prod.google.com ([2002:a05:6a00:810c:b0:848:40f5:a538]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:4b02:b0:847:8acd:747c with SMTP id d2e1a72fcca58-84f2e022980mr28214031b3a.13.1786143974654; Fri, 07 Aug 2026 16:06:14 -0700 (PDT) Date: Fri, 7 Aug 2026 16:06:14 -0700 In-Reply-To: <6bb4252cf3c41de5e58cce5c5de02660d8350f47.camel@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260807071934.786879-1-zeng_chi911@163.com> <6bb4252cf3c41de5e58cce5c5de02660d8350f47.camel@intel.com> Message-ID: Subject: Re: [PATCH] KVM: Remove the kvm debugfs directory if kvm_init() fails From: Sean Christopherson To: Kai Huang Cc: "zeng_chi911@163.com" , "zengchi@kylinos.cn" , "kvm@vger.kernel.org" , "pbonzini@redhat.com" , "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="us-ascii" On Fri, Aug 07, 2026, Kai Huang wrote: > > > > > > The stale /sys/kernel/debug/kvm directory isn't just cosmetic: a > > > subsequent attempt to load KVM makes debugfs_create_dir() fail with > > > -EEXIST, after which kvm_debugfs_dir holds an ERR_PTR and all stat > > > files are silently never created again. Worse, the leaked stat files > > > reference file_operations and stat data that live in the KVM module; if > > > the module is unloaded after the failed initialization, reading the > > > stale files is a use-after-free. > > > > > > > > [...] > > > > > Already posted (twice) and applied: > > > > https://lore.kernel.org/all/20260706095910.39798-1-leixiang@kylinos.cn > > Do we need to "Cc: stable"? The one in your tree (commit db3a46e200df2) doesn't > have that. I was thinking "no", as I don't think it's likely to be problematic outside of fuzzers and error injection, but I also wouldn't object if someone feels strongly that it should be sent to LTS kernels.