]> git.baikalelectronics.ru Git - kernel.git/commit
livepatch: Cleanup module page permission changes
authorJosh Poimboeuf <jpoimboe@redhat.com>
Thu, 3 Dec 2015 22:33:26 +0000 (16:33 -0600)
committerJiri Kosina <jkosina@suse.cz>
Fri, 4 Dec 2015 21:51:07 +0000 (22:51 +0100)
commit9ad1c8dc1d4a4f708fe0a6e7bcf902fb60948379
treeb95a1d26730cf2389214e303199c25bc160134c9
parent6be82a63337e24c5ae9e414c048fc8fda30c42eb
livepatch: Cleanup module page permission changes

Calling set_memory_rw() and set_memory_ro() for every iteration of the
loop in klp_write_object_relocations() is messy, inefficient, and
error-prone.

Change all the read-only pages to read-write before the loop and convert
them back to read-only again afterwards.

Suggested-by: Miroslav Benes <mbenes@suse.cz>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
arch/x86/kernel/livepatch.c
kernel/livepatch/core.c