[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211129034509.2646872-1-ming.lei@redhat.com>
Date: Mon, 29 Nov 2021 11:45:07 +0800
From: Ming Lei <ming.lei@...hat.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Petr Mladek <pmladek@...e.com>, linux-kernel@...r.kernel.org,
Luis Chamberlain <mcgrof@...nel.org>,
Ming Lei <ming.lei@...hat.com>
Subject: [PATCH V2 0/2] kobject: avoid to cleanup kobject after module is unloaded
Hello,
The 1st patch improves CONFIG_DEBUG_KOBJECT_RELEASE, so that kobject
cleanup after unloading module can be triggered easily. With this patch,
'modprobe kset-example' can trigger the issue very quickly.
The 2nd patch fixes the issue of cleaning up object after module is
unloaded, since kobj->ktype and related callbacks are often allocated
as module static variable. We need to make sure kobject is really
cleaned up before freeing module. This issue is reported by Petr Mladek.
V2:
- add comment on 1st patch, suggested by Greg, 1/2
- fix build failure in case that CONFIG_MODULE is disabled, and add
comment in kobj_module_callback(), 2/2
Ming Lei (2):
kobject: don't delay to cleanup module kobject
kobject: wait until kobject is cleaned up before freeing module
include/linux/kobject.h | 1 +
lib/kobject.c | 82 +++++++++++++++++++++++++++++++++++++++++
2 files changed, 83 insertions(+)
--
2.31.1
Powered by blists - more mailing lists