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: <a50941ad-ae74-933e-4d22-f4c67bafc0c1@intel.com>
Date:   Tue, 20 Sep 2022 16:36:43 +0300
From:   Adrian Hunter <adrian.hunter@...el.com>
To:     Namhyung Kim <namhyung@...nel.org>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Jiri Olsa <jolsa@...nel.org>
Cc:     Ingo Molnar <mingo@...nel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Ian Rogers <irogers@...gle.com>,
        linux-perf-users@...r.kernel.org
Subject: Re: [PATCH 4/4] perf tools: Honor namespace when synthesizing
 build-id

On 16/09/22 20:59, Namhyung Kim wrote:
> It needs to go into a namespace before reading a file.

This looks like a fix, in which case make it the first patch
and add a fixes tag?

> 
> Signed-off-by: Namhyung Kim <namhyung@...nel.org>
> ---
>  tools/perf/util/synthetic-events.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/tools/perf/util/synthetic-events.c b/tools/perf/util/synthetic-events.c
> index e6978b2dee8f..d0d540d09196 100644
> --- a/tools/perf/util/synthetic-events.c
> +++ b/tools/perf/util/synthetic-events.c
> @@ -391,6 +391,8 @@ static void perf_record_mmap2__read_build_id(struct perf_record_mmap2 *event,
>  	struct build_id _bid, *bid = &_bid;
>  	struct dso *dso = NULL;
>  	struct dso_id id;
> +	struct nsinfo *nsi;
> +	struct nscookie nc;
>  	int rc;
>  
>  	if (is_kernel) {
> @@ -410,8 +412,14 @@ static void perf_record_mmap2__read_build_id(struct perf_record_mmap2 *event,
>  		goto out;
>  	}
>  
> +	nsi = nsinfo__new(event->pid);
> +	nsinfo__mountns_enter(nsi, &nc);
> +
>  	rc = filename__read_build_id(event->filename, bid) > 0 ? 0 : -1;
>  
> +	nsinfo__mountns_exit(&nc);
> +	nsinfo__put(nsi);
> +
>  out:
>  	if (rc == 0) {
>  		memcpy(event->build_id, bid->data, sizeof(bid->data));

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ