summaryrefslogtreecommitdiff
path: root/kernel/kexec_core.c
diff options
context:
space:
mode:
authorKonstantin Khorenko <khorenko@virtuozzo.com>2019-11-13 12:29:50 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-12-21 10:42:21 +0100
commit5defd32bc25f3b72265730e1b16aa49056564cde (patch)
tree8d9e1e3a7d5c89c2c72747d7fc0622b0ad08ae1b /kernel/kexec_core.c
parentf265cbdab03d1c6c7617a2a23a4107cb10bf5f9f (diff)
kernel/module.c: wakeup processes in module_wq on module unload
[ Upstream commit 5d603311615f612320bb77bd2a82553ef1ced5b7 ] Fix the race between load and unload a kernel module. sys_delete_module() try_stop_module() mod->state = _GOING add_unformed_module() old = find_module_all() (old->state == _GOING => wait_event_interruptible()) During pre-condition finished_loading() rets 0 schedule() (never gets waken up later) free_module() mod->state = _UNFORMED list_del_rcu(&mod->list) (dels mod from "modules" list) return The race above leads to modprobe hanging forever on loading a module. Error paths on loading module call wake_up_all(&module_wq) after freeing module, so let's do the same on straight module unload. Fixes: 6e6de3dee51a ("kernel/module.c: Only return -EEXIST for modules that have finished loading") Reviewed-by: Prarit Bhargava <prarit@redhat.com> Signed-off-by: Konstantin Khorenko <khorenko@virtuozzo.com> Signed-off-by: Jessica Yu <jeyu@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'kernel/kexec_core.c')
0 files changed, 0 insertions, 0 deletions