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: <CANLsYkzQhV-0+LBDFT+2op0tLi_sZjoMoWYYr+DsJoeB9tXZBg@mail.gmail.com>
Date:   Mon, 18 Mar 2019 11:13:50 -0600
From:   Mathieu Poirier <mathieu.poirier@...aro.org>
To:     Yue Haibing <yuehaibing@...wei.com>
Cc:     "Suzuki K. Poulose" <suzuki.poulose@....com>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Jiri Olsa <jolsa@...hat.com>,
        Namhyung Kim <namhyung@...nel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH] perf tools: return errcode in cs_etm__process_auxtrace_info

Good day Yue,

On Thu, 14 Mar 2019 at 20:28, Yue Haibing <yuehaibing@...wei.com> wrote:
>
> From: YueHaibing <yuehaibing@...wei.com>
>
> 'err' is set in err path, but it's not returned to callers.
> Also fix a pass zero to PTR_ERR issue.
>
> Fixes: cd8bfd8c973e ("perf tools: Add processing of coresight metadata")
> Signed-off-by: YueHaibing <yuehaibing@...wei.com>
> ---
>  tools/perf/util/cs-etm.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c
> index 1108049..111f33c 100644
> --- a/tools/perf/util/cs-etm.c
> +++ b/tools/perf/util/cs-etm.c
> @@ -1908,7 +1908,7 @@ int cs_etm__process_auxtrace_info(union perf_event *event,
>
>                 /* Something went wrong, no need to continue */
>                 if (!inode) {
> -                       err = PTR_ERR(inode);
> +                       err = -ENOMEM;

Good catch.

>                         goto err_free_metadata;
>                 }
>
> @@ -2023,5 +2023,5 @@ int cs_etm__process_auxtrace_info(union perf_event *event,
>  err_free_hdr:
>         zfree(&hdr);
>
> -       return -EINVAL;
> +       return err;

If we do that we need to set 'err' to an error code here [1] and here
[2].  Do you think you could fix this and roll another version of your
patch?

[1]. https://elixir.bootlin.com/linux/v5.1-rc1/source/tools/perf/util/cs-etm.c#L1967
[2]. https://elixir.bootlin.com/linux/v5.1-rc1/source/tools/perf/util/cs-etm.c#L1981
>  }
> --
> 2.7.0
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ