Bug in patch "x86/pti: Add the pti= cmdline option and documentation"
The patch in the tip tree with commit 506bcdf68b07a0335751e1fe8be37 ("x86/pti: Add the pti= cmdline option and documentation") is completely
wrong: cmdline_find_option() will return -1 in case the otion isn't found and the len of the argument in case it has been found.
Juergen
Quoted 4 lines · Juergen Gross
The patch in the tip tree with commit
506bcdf68b07a0335751e1fe8be37("x86/pti: Add the pti= cmdline option and documentation") is completely
wrong:cmdline_find_option()will return -1 in case the otion isn't found and the len of the argument in case it has been found.
It is not completely wrong - we still walk into the if-branch. Besides, we moved the xen check upwards, before that so it is not relevant for the xen case.
Regardless, I'll send a correction soon to check the retval directly.
Signature · 5 lines
Regards/Gruss,
Boris.
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
-- Quoted 4 lines · Juergen Gross
The patch in the tip tree with commit
506bcdf68b07a0335751e1fe8be37("x86/pti: Add the pti= cmdline option and documentation") is completely
wrong:cmdline_find_option()will return -1 in case the otion isn't found and the len of the argument in case it has been found.
AArgh .....
Quoted 8 lines · Thomas Gleixner
Quoted 4 lines · Juergen Gross
The patch in the tip tree with commit
506bcdf68b07a0335751e1fe8be37("x86/pti: Add the pti= cmdline option and documentation") is completely
wrong:cmdline_find_option()will return -1 in case the otion isn't found and the len of the argument in case it has been found.AArgh .....
Please fold this in:
---
arch/x86/mm/pti.c +3 -1
@@ -69,13 +69,15 @@ static void __init pti_print_if_secure(const char *reason)void __init pti_check_boottime_disable (void ) {char arg[5 ]; +int ret;if (hypervisor_is_type (X86_HYPER_XEN_PV )) {pti_print_if_insecure ("disabled on XEN PV." );return ; } -if (cmdline_find_option (boot_command_line,"pti" , arg,sizeof (arg))) { + ret =cmdline_find_option (boot_command_line,"pti" , arg,sizeof (arg)); +if (ret >0 ) {if (!strncmp (arg,"off" ,3 )) {pti_print_if_insecure ("disabled on command line." );return ;
Signature · 5 lines
Regards/Gruss,
Boris.
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
--