diff options
author | Josh Poimboeuf <jpoimboe@redhat.com> | 2015-01-09 15:03:04 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2015-01-09 16:27:47 -0500 |
commit | 99590ba565a22c9f58f7528a94881d0455eef018 (patch) | |
tree | 5c0fc1368e6e6ea99b8bf644a706ed276c051808 /kernel/livepatch | |
parent | b9dfe0bed999d23ee8838d389637dd8aef83fafa (diff) |
livepatch: fix deferred module patching order
When applying multiple patches to a module, if the module is loaded
after the patches are loaded, the patches are applied in reverse order:
$ insmod patch1.ko
[ 43.172992] livepatch: enabling patch 'patch1'
$ insmod patch2.ko
[ 46.571563] livepatch: enabling patch 'patch2'
$ modprobe nfsd
[ 52.888922] livepatch: applying patch 'patch2' to loading module 'nfsd'
[ 52.899847] livepatch: applying patch 'patch1' to loading module 'nfsd'
Fix the loading order by storing the klp_patches list in queue order.
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'kernel/livepatch')
-rw-r--r-- | kernel/livepatch/core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c index ce42d3b930dc..3d9c00b5223a 100644 --- a/kernel/livepatch/core.c +++ b/kernel/livepatch/core.c | |||
@@ -739,7 +739,7 @@ static int klp_init_patch(struct klp_patch *patch) | |||
739 | goto free; | 739 | goto free; |
740 | } | 740 | } |
741 | 741 | ||
742 | list_add(&patch->list, &klp_patches); | 742 | list_add_tail(&patch->list, &klp_patches); |
743 | 743 | ||
744 | mutex_unlock(&klp_mutex); | 744 | mutex_unlock(&klp_mutex); |
745 | 745 | ||