Thread (29 messages) 29 messages, 8 authors, 2021-01-28

Re: [PATCH 04/13] livepatch: move klp_find_object_module to module.c

From: Josh Poimboeuf <hidden>
Date: 2021-01-21 21:48:05
Also in: dri-devel, linux-kbuild, linuxppc-dev, lkml

On Thu, Jan 21, 2021 at 08:49:50AM +0100, Christoph Hellwig wrote:
quoted hunk ↗ jump to hunk
@@ -820,14 +796,25 @@ static int klp_init_object(struct klp_patch *patch, struct klp_object *obj)
 	const char *name;
 
 	obj->patched = false;
-	obj->mod = NULL;
Why was this line removed?
 	if (klp_is_module(obj)) {
 		if (strlen(obj->name) >= MODULE_NAME_LEN)
 			return -EINVAL;
 		name = obj->name;
 
-		klp_find_object_module(obj);
+		/*
+		 * We do not want to block removal of patched modules and
+		 * therefore we do not take a reference here. The patches are
+		 * removed by klp_module_going() instead.
+		 * 
+		 * Do not mess work of klp_module_coming() and
+		 * klp_module_going().  Note that the patch might still be
+		 * needed before klp_module_going() is called.  Module functions
+		 * can be called even in the GOING state until mod->exit()
+		 * finishes.  This is especially important for patches that
+		 * modify semantic of the functions.
+		 */
+		obj->mod = find_klp_module(obj->name);
These comments don't make sense in this context, they should be kept
with the code in find_klp_module().

-- 
Josh
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help