From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CA2E0606A336 for ; Wed, 18 Nov 2026 21:11:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=kuXqBQo9 Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6B54E10ECA3; Wed, 18 Nov 2026 21:11:38 +0000 (UTC) Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by gabe.freedesktop.org (Postfix) with ESMTPS id 290A510ECA3; Wed, 18 Nov 2026 21:11:32 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 2624E63DC5; Wed, 18 Nov 2026 21:11:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4625B1F000C4; Wed, 18 Nov 2026 21:11:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795036290; bh=fYW7C7ZSeq/hMphn21Jk8+ekBniTzrghgjy5BvzP2bc=; h=Date:Cc:To:From:Subject:References:In-Reply-To; b=kuXqBQo9E+h9GfS4TOHEmqgk/yUMmLyRthOV87kyoVvVOAzwMpnvqD7A1XkucwxwG +Vl7bpZlxX0JE1vzCQVuNBvbZMaKuIBAvlXTPAUK/GTa7v0LsXaOQ5W64VpbC1VuJl uqJ8OInlapAXmctcRxyW0008D6Xzwyp9lCFH5W/hdRpNqLETcSMRWepnBuLx7zwxxU Sylw1ch5ITJRoQmWb3zw4zYMMrzwKyJn/UZhs2/85dIxkfhwlxjTdBpT9dCJJryN21 FmmGw4YgDxUh6xSvFjYiQgrHT7xeYbJw48awVnPj+qHidKGuRNABBugA/RDx9fw+YY xy76njp+TsmiA== X-Archived-By: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Wed, 18 Nov 2026 22:11:20 +0100 Message-Id: Cc: "Greg Kroah-Hartman" , "Kees Cook" , "Miguel Ojeda" , "Rafael J . Wysocki" , "Madhavan Srinivasan" , "Michael Ellerman" , "Nicholas Piggin" , "Christophe Leroy" , "Nayna Jain" , "Srish Srinivasan" , "Mimi Zohar" , "Yoshinori Sato" , "Rich Felker" , "John Paul Adrian Glaubitz" , "Juergen Gross" , "Stefano Stabellini" , "Oleksandr Tyshchenko" , "Nathan Chancellor" , "Nick Desaulniers" , "Viresh Kumar" , "Zhongqiu Han" , "Alexander Aring" , "Felix Kuehling" , =?utf-8?q?Christian_K=C3=B6nig?= , "Zhihao Cheng" , "Sumanth Korikkar" , "Bill Wendling" , "Justin Stitt" , , , , , , , , , , , , , , , , To: "Ian Rogers" From: "Danilo Krummrich" Subject: Re: [PATCH v3 9/9] kobject: Require explicit initialization of struct kobj_type::release References: <20261108223913.3624571-1-irogers@google.com> <20261108223913.3624571-10-irogers@google.com> In-Reply-To: <20261108223913.3624571-10-irogers@google.com> X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "amd-gfx" X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Sun Nov 8, 2026 at 11:39 PM CET, Ian Rogers wrote: > static const struct kobj_type cpuregs_kobj_type =3D { > + /* > + * Pre-existing: info->kobj is embedded in per-CPU cpu_data; > + * cpuid_cpu_offline() only calls kobject_del(). > + */ All of these comments carry a =E2=80=9CPre-existing:=E2=80=9D prefix, but t= hat doesn=E2=80=99t distinguish cases with broken lifetime management from those where the stor= age remains valid despite the API misuse. For example: > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c b/drivers/gpu/drm/am= d/amdgpu/amdgpu_xcp.c > index ab14079d1c42..0847134a1391 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c > @@ -797,6 +797,11 @@ static const struct sysfs_ops xcp_cfg_res_sysfs_ops = =3D { > }; > =20 > static const struct kobj_type xcp_cfg_res_sysfs_ktype =3D { > + /* > + * Pre-existing: xcp_res is embedded in struct amdgpu_xcp_cfg > + * rather than freed individually by kobject_put(). > + */ > + .release =3D NULL, Being embedded in another structure doesn't explain what guarantees that th= e enclosing allocation outlives the kobject=E2=80=99s final cleanup. Could you please drop the =E2=80=9CPre-existing:=E2=80=9D prefix and make t= hat distinction explicit? For broken cases, describe the lifetime problem and mark it as ne= eding a follow-up fix. For cases where the lifetime is safe, explain what guarant= ees that safety, while acknowledging that omitting release() still violates the documented API contract. Also, do you plan to follow up on those cases? Thanks, Danilo