linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/1] misc: Prevent double registration and deregistration of miscdevice
@ 2025-08-25  8:45 xion.wang
  2025-08-25  8:45 ` [PATCH 1/1] " xion.wang
  2025-08-25 20:27 ` [PATCH 0/1] " Greg Kroah-Hartman
  0 siblings, 2 replies; 11+ messages in thread
From: xion.wang @ 2025-08-25  8:45 UTC (permalink / raw)
  To: Arnd Bergmann, Greg Kroah-Hartman, Matthias Brugger,
	AngeloGioacchino Del Regno
  Cc: wsd_upstream, huadian.liu, Xion Wang, linux-kernel,
	linux-arm-kernel, linux-mediatek

From: Xion Wang <xion.wang@mediatek.com>

Dear maintainers,

I am submitting a patch to improve the robustness of the misc device subsystem in the Linux kernel.

In the current implementation, repeated calls to misc_register() or misc_deregister() on the same miscdevice instance may result in corruption of the misc_list or kernel crash due to multiple INIT_LIST_HEAD or list_del operations on the same list node.

This patch introduces additional checks in both misc_register() and misc_deregister() to prevent double registration and double deregistration. By using misc->this_device as a status flag, the driver can safely determine whether the device has already been registered or deregistered, and avoid performing dangerous operations on the misc_list.

With these changes, the misc device subsystem becomes more stable and reliable, reducing the risks of list corruption and improving overall system safety.

Feedback and suggestions are welcome.

Thank you for your time and consideration.

Best regards,
Xion Wang

Xion Wang (1):
  misc: Prevent double registration and deregistration of miscdevice

 drivers/char/misc.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

-- 
2.45.2



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2025-09-02  1:45 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-25  8:45 [PATCH 0/1] misc: Prevent double registration and deregistration of miscdevice xion.wang
2025-08-25  8:45 ` [PATCH 1/1] " xion.wang
2025-08-25 20:28   ` Greg Kroah-Hartman
2025-08-26  2:55     ` Xion Wang (王鑫)
2025-08-26  7:05       ` gregkh
2025-08-26  7:58         ` Xion Wang (王鑫)
2025-08-26 10:40           ` gregkh
2025-08-26 12:09             ` Xion Wang (王鑫)
2025-08-26 12:54               ` gregkh
2025-09-02  1:42                 ` Xion Wang (王鑫)
2025-08-25 20:27 ` [PATCH 0/1] " Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).