Displaying 1 result from an estimated 1 matches for "__module_address".
2023 Jan 26
1
[PATCH 2/2] vhost: check for pending livepatches from vhost worker kthreads
...* It would allow to remove the livepatch module even when
 * the code still might be in use.
 */
void klp_update_patch_state_safe(struct task_struct *task, void *caller_addr)
{
	static bool checked;
	static bool safe;
	if (unlikely(!checked)) {
		struct module *mod;
		preempt_disable();
		mod = __module_address(caller_addr);
		if (!mod || !is_livepatch_module(mod))
			safe = true;
		checked = true;
		preempt_enable();
	}
	if (safe)
		klp_update_patch_state(task);
}
and use in vhost_worker()
		if (unlikely(klp_patch_pending(current)))
			klp_update_patch_state_safe(current, vhost_worker);
Even better m...