livepatch: Add a missing newline character in klp_module_coming()
PATCH 1/1 livepatch: Add a missing newline character in klp_module_coming()
The error message is not printed immediately because it does not end with a newline character.
Before:
root@localhost:~# insmod vmlinux.ko insmod: ERROR: could not insert module vmlinux.ko: Invalid parameters
After:
root@localhost:~# insmod vmlinux.ko [ 43.982558] livepatch: vmlinux.ko: invalid module name insmod: ERROR: could not insert module vmlinux.ko: Invalid parameters
Fixes dcf550e52f56 ("livepatch: Disallow vmlinux.ko")
Signed-off-by Zhen Lei <[email protected]>
--- kernel/livepatch/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/livepatch/core.c +1 -1
@@ -1171,7 +1171,7 @@ int klp_module_coming(struct module *mod)return -EINVAL ;if (!strcmp (mod->name,"vmlinux" )) { -pr_err ("vmlinux.ko: invalid module name" ); +pr_err ("vmlinux.ko: invalid module name\n" );return -EINVAL ; }
Signature · 1 line
2.25.1
Quoted 7 lines · Zhen Lei
The error message is not printed immediately because it does not end with a newline character.
Before:
root@localhost:~# insmod vmlinux.ko insmod: ERROR: could not insert module vmlinux.ko: Invalid parameters
Quoted 7 lines
After:
root@localhost:~# insmod vmlinux.ko [ 43.982558] livepatch: vmlinux.ko: invalid module name insmod: ERROR: could not insert module vmlinux.ko: Invalid parametersFixes dcf550e52f56 ("livepatch: Disallow vmlinux.ko")Signed-off-by Zhen Lei <[email protected]>
Great catch! The message is not pushed to the console because the line is not finished and might be eventually extended by pr_cont().
Reviewed-by Petr Mladek <[email protected]>
The fix is trivial. I have pushed it into livepatching/livepatching.git, branch for-6.1/fixes.
Best Regards,
Petr