All of lore.kernel.org
 help / color / mirror / Atom feed
From: Madhavan Srinivasan <maddy@linux.ibm.com>
To: Ian Rogers <irogers@google.com>, Nayna Jain <nayna@linux.ibm.com>,
	Michael Ellerman <mpe@ellerman.id.au>, Piggin <npiggin@gmail.com>,
	"Christophe Leroy (CS GROUP)" <chleroy@kernel.org>,
	"Ritesh Harjani (IBM)" <ritesh.list@gmail.com>,
	Shrikanth Hegde <sshegde@linux.ibm.com>
Cc: Srish Srinivasan <ssrish@linux.ibm.com>,
	Mimi Zohar <zohar@linux.ibm.com>,
	Danilo Krummrich <dakr@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
	driver-core@lists.linux.dev, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 2/9] powerpc/secvar: Add missing kobject release callback to secvar_ktype
Date: Wed, 18 Nov 2026 16:57:45 +0530	[thread overview]
Message-ID: <11020f85-6e45-4a2f-bd72-b006e337623d@linux.ibm.com> (raw)
In-Reply-To: <CAP-5=fUQvqpny1CrYVUqg9SQo6VpOuUqfOK403BxK_vWCDU30w@mail.gmail.com>


On 11/18/26 1:55 AM, Ian Rogers wrote:
> On Sun, Nov 8, 2026 at 2:39 PM Ian Rogers <irogers@google.com> wrote:
>> In add_var(), a struct kobject is dynamically allocated with
>> kzalloc_obj() and initialized with secvar_ktype. If kobject_add() or
>> sysfs_create_file() fails, kobject_put(kobj) is called to clean up.
>> However, secvar_ktype does not define a .release callback, which results
>> in a memory leak of kobj (and a pr_debug warning in kobject_cleanup()
>> when CONFIG_DEBUG_KOBJECT_RELEASE is enabled).
>>
>> Provide a secvar_release() callback that calls kfree(kobj).
>>
>> Fixes: bd5d9c743d38 ("powerpc: expose secure variables to userspace via sysfs")
>> Signed-off-by: Ian Rogers <irogers@google.com>
> Gentle ping on this patch (moving PowerPC maintainers to To: in case
> this got buried in Cc:).
>
> Danilo offered to take the full 9-patch kobj_type::release __must_init
> series through the driver-core tree with subsystem ACKs, and this is
> one of the last two patches awaiting an Acked-by. Does this look okay
> to go via driver-core?
Sure Ian

Acked-by: Madhavan Srinivasan <maddy@linux.ibm.com>

>
> Thanks,
> Ian
>
>> ---
>>   arch/powerpc/kernel/secvar-sysfs.c | 6 ++++++
>>   1 file changed, 6 insertions(+)
>>
>> diff --git a/arch/powerpc/kernel/secvar-sysfs.c b/arch/powerpc/kernel/secvar-sysfs.c
>> index 395399bbab2c..f3f6ac25ea78 100644
>> --- a/arch/powerpc/kernel/secvar-sysfs.c
>> +++ b/arch/powerpc/kernel/secvar-sysfs.c
>> @@ -126,7 +126,13 @@ static const struct attribute_group secvar_attr_group = {
>>   };
>>   __ATTRIBUTE_GROUPS(secvar_attr);
>>
>> +static void secvar_release(struct kobject *kobj)
>> +{
>> +       kfree(kobj);
>> +}
>> +
>>   static const struct kobj_type secvar_ktype = {
>> +       .release        = secvar_release,
>>          .sysfs_ops      = &kobj_sysfs_ops,
>>          .default_groups = secvar_attr_groups,
>>   };
>> --
>> 2.56.0.455.g6c5a503b38-goog
>>

  reply	other threads:[~2026-11-18 11:28 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-08 22:39 [PATCH v3 0/9] Add __must_init and require explicit kobj_type::release Ian Rogers
2026-11-08 22:39 ` Ian Rogers
2026-11-08 22:39 ` [PATCH v3 1/9] Compiler Attributes: Add __must_init macro Ian Rogers
2026-11-08 22:39   ` Ian Rogers
2026-11-08 22:45   ` sashiko-bot
2026-11-08 22:39 ` [PATCH v3 2/9] powerpc/secvar: Add missing kobject release callback to secvar_ktype Ian Rogers
2026-11-08 22:39   ` Ian Rogers
2026-11-08 22:50   ` sashiko-bot
2026-11-17 20:25   ` Ian Rogers
2026-11-18 11:27     ` Madhavan Srinivasan [this message]
2026-11-18  8:17   ` Srish Srinivasan
2026-11-18  8:17     ` Srish Srinivasan
2026-11-08 22:39 ` [PATCH v3 3/9] sh: sq: Add missing kobject release callback to ktype_percpu_entry Ian Rogers
2026-11-08 22:39   ` Ian Rogers
2026-11-08 22:55   ` sashiko-bot
2026-11-17 20:28   ` Ian Rogers
2026-11-18  7:18     ` John Paul Adrian Glaubitz
2026-11-18  7:20   ` John Paul Adrian Glaubitz
2026-11-18  7:20     ` John Paul Adrian Glaubitz
2026-11-08 22:39 ` [PATCH v3 4/9] cpufreq: governor: Initialize kobj_type release callback statically Ian Rogers
2026-11-08 22:39   ` Ian Rogers
2026-11-08 22:58   ` sashiko-bot
2026-11-08 22:39 ` [PATCH v3 5/9] dlm: Free dlm_ls in kobject release callback Ian Rogers
2026-11-08 22:39   ` Ian Rogers
2026-11-08 23:06   ` sashiko-bot
2026-11-08 23:06     ` sashiko-bot
2026-11-08 22:39 ` [PATCH v3 6/9] xen/sys-hypervisor: Add release callback to hyp_sysfs_kobj_type Ian Rogers
2026-11-08 22:39   ` Ian Rogers
2026-11-08 23:08   ` sashiko-bot
2026-11-09  6:56   ` Juergen Gross
2026-11-09  6:56     ` Juergen Gross
2026-11-09 22:29     ` Ian Rogers
2026-11-09 22:29       ` Ian Rogers
2026-11-08 22:39 ` [PATCH v3 7/9] ubifs: sysfs: Use kset_create_and_add() for ubifs_kset Ian Rogers
2026-11-08 22:39   ` Ian Rogers
2026-11-08 23:10   ` sashiko-bot
2026-11-08 23:10     ` sashiko-bot
2026-11-08 22:39 ` [PATCH v3 8/9] drm/amdkfd: Free queue in procfs_queue_type kobject release callback Ian Rogers
2026-11-08 22:39   ` Ian Rogers
2026-11-08 23:15   ` sashiko-bot
2026-11-08 22:39 ` [PATCH v3 9/9] kobject: Require explicit initialization of struct kobj_type::release Ian Rogers
2026-11-08 22:39   ` Ian Rogers
2026-11-08 23:27   ` sashiko-bot
2026-11-18 21:11   ` Danilo Krummrich
2026-11-18 21:11     ` Danilo Krummrich
2026-11-19  5:45     ` Ian Rogers
2026-11-19  5:45       ` Ian Rogers
2026-11-18 17:12 ` [PATCH v3 0/9] Add __must_init and require explicit kobj_type::release Ian Rogers
2026-11-18 21:00   ` Danilo Krummrich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=11020f85-6e45-4a2f-bd72-b006e337623d@linux.ibm.com \
    --to=maddy@linux.ibm.com \
    --cc=chleroy@kernel.org \
    --cc=dakr@kernel.org \
    --cc=driver-core@lists.linux.dev \
    --cc=gregkh@linuxfoundation.org \
    --cc=irogers@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=nayna@linux.ibm.com \
    --cc=npiggin@gmail.com \
    --cc=ritesh.list@gmail.com \
    --cc=sshegde@linux.ibm.com \
    --cc=ssrish@linux.ibm.com \
    --cc=zohar@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.