lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170619183235.GQ3645@kernel.org>
Date:   Mon, 19 Jun 2017 15:32:35 -0300
From:   Arnaldo Carvalho de Melo <acme@...nel.org>
To:     Taeung Song <treeze.taeung@...il.com>
Cc:     linux-kernel@...r.kernel.org, Jiri Olsa <jolsa@...nel.org>,
        Namhyung Kim <namhyung@...nel.org>
Subject: Re: [PATCH v4 1/5] perf config: Check error cases of {show_spec,
 set}_config()

Em Sat, Jun 17, 2017 at 12:46:37PM +0900, Taeung Song escreveu:
> show_spec_config() and set_config() can be called multiple times
> in the loop in cmd_config().
> However, The error cases of them wasn't checked, so fix it.

Thanks, applied.
 
> Reported-by: Arnaldo Carvalho de Melo <acme@...hat.com>
> Cc: Jiri Olsa <jolsa@...nel.org>
> Cc: Namhyung Kim <namhyung@...nel.org>
> Signed-off-by: Taeung Song <treeze.taeung@...il.com>
> ---
>  tools/perf/builtin-config.c | 17 +++++++++++++++--
>  1 file changed, 15 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/perf/builtin-config.c b/tools/perf/builtin-config.c
> index 7545966..bb1be79 100644
> --- a/tools/perf/builtin-config.c
> +++ b/tools/perf/builtin-config.c
> @@ -225,10 +225,23 @@ int cmd_config(int argc, const char **argv)
>  				break;
>  			}
>  
> -			if (value == NULL)
> +			if (value == NULL) {
>  				ret = show_spec_config(set, var);
> -			else
> +				if (ret < 0) {
> +					pr_err("%s is not configured: %s\n",
> +					       var, config_filename);
> +					free(arg);
> +					break;
> +				}
> +			} else {
>  				ret = set_config(set, config_filename, var, value);
> +				if (ret < 0) {
> +					pr_err("Failed to set '%s=%s' on %s\n",
> +					       var, value, config_filename);
> +					free(arg);
> +					break;
> +				}
> +			}
>  			free(arg);
>  		}
>  	}
> -- 
> 2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ