Skip to content
Commit a6aeb739 authored by Dmitry Antipov's avatar Dmitry Antipov Committed by Petr Pavlu
Browse files

module: ensure that kobject_put() is safe for module type kobjects



In 'lookup_or_create_module_kobject()', an internal kobject is created
using 'module_ktype'. So call to 'kobject_put()' on error handling
path causes an attempt to use an uninitialized completion pointer in
'module_kobject_release()'. In this scenario, we just want to release
kobject without an extra synchronization required for a regular module
unloading process, so adding an extra check whether 'complete()' is
actually required makes 'kobject_put()' safe.

Reported-by: default avatar <syzbot+7fb8a372e1f6add936dd@syzkaller.appspotmail.com>
Closes: https://syzkaller.appspot.com/bug?extid=7fb8a372e1f6add936dd


Fixes: 942e4431 ("module: Fix mod->mkobj.kobj potentially freed too early")
Cc: stable@vger.kernel.org
Suggested-by: default avatarPetr Pavlu <petr.pavlu@suse.com>
Signed-off-by: default avatarDmitry Antipov <dmantipov@yandex.ru>
Link: https://lore.kernel.org/r/20250507065044.86529-1-dmantipov@yandex.ru


Signed-off-by: default avatarPetr Pavlu <petr.pavlu@suse.com>
parent 92a09c47
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment