[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 39/52] xen: check parameter validity when parsing command line
On 10/08/17 15:02, Wei Liu wrote: > On Wed, Aug 09, 2017 at 09:06:53AM +0200, Juergen Gross wrote: >> Where possible check validity of parameters in _cmdline_parse() and >> issue a warning message in case of an error detected. >> >> Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> >> Cc: George Dunlap <George.Dunlap@xxxxxxxxxxxxx> >> Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx> >> Cc: Jan Beulich <jbeulich@xxxxxxxx> >> Cc: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx> >> Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx> >> Cc: Tim Deegan <tim@xxxxxxx> >> Cc: Wei Liu <wei.liu2@xxxxxxxxxx> >> Signed-off-by: Juergen Gross <jgross@xxxxxxxx> >> --- >> xen/common/kernel.c | 44 ++++++++++++++++++++++++++++++++++---------- >> 1 file changed, 34 insertions(+), 10 deletions(-) >> >> diff --git a/xen/common/kernel.c b/xen/common/kernel.c >> index ce7cb8adb5..3fd3abe79c 100644 >> --- a/xen/common/kernel.c >> +++ b/xen/common/kernel.c >> @@ -23,9 +23,11 @@ enum system_state system_state = SYS_STATE_early_boot; >> xen_commandline_t saved_cmdline; >> static const char __initconst opt_builtin_cmdline[] = CONFIG_CMDLINE; >> >> -static void __init assign_integer_param( >> +static int __init assign_integer_param( >> const struct kernel_param *param, uint64_t val) >> { >> + unsigned int bits = param->len * 8; >> + > > BITS_PER_BYTE here. Okay. > > Otherwise: > > Reviewed-by: Wei Liu <wei.liu2@xxxxxxxxxx> BTW: I've spotted a problem with parse_bool() in my patch: It should accept an empty string as "true", as specifying e.g. "sync_console" should set this option instead of issuing an error message. Does your R-b: still stand with the correction below? @@ -176,7 +200,8 @@ int __init parse_bool(const char *s) !strcmp("on", s) || !strcmp("true", s) || !strcmp("enable", s) || - !strcmp("1", s) ) + !strcmp("1", s) || + !strcmp("", s) ) return 1; return -1; Thanks, Juergen _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |