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]
Date:   Thu, 24 Sep 2020 15:09:09 +0200
From:   Jiri Olsa <jolsa@...hat.com>
To:     Namhyung Kim <namhyung@...nel.org>
Cc:     Arnaldo Carvalho de Melo <acme@...nel.org>,
        Ingo Molnar <mingo@...nel.org>,
        Peter Zijlstra <a.p.zijlstra@...llo.nl>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        LKML <linux-kernel@...r.kernel.org>,
        Stephane Eranian <eranian@...gle.com>,
        Ian Rogers <irogers@...gle.com>
Subject: Re: [PATCH 4/7] perf inject: Do not load map/dso when injecting
 build-id

On Wed, Sep 23, 2020 at 05:05:34PM +0900, Namhyung Kim wrote:

SNIP

> -static inline int is_no_dso_memory(const char *filename)
> -{
> -	return !strncmp(filename, "[stack", 6) ||
> -	       !strncmp(filename, "/SYSV",5)   ||
> -	       !strcmp(filename, "[heap]");
> -}
> -
>  static inline int is_android_lib(const char *filename)
>  {
>  	return strstarts(filename, "/data/app-lib/") ||
> @@ -158,7 +143,7 @@ struct map *map__new(struct machine *machine, u64 start, u64 len,
>  		int anon, no_dso, vdso, android;
>  
>  		android = is_android_lib(filename);
> -		anon = is_anon_memory(filename, flags);
> +		anon = is_anon_memory(filename) || flags & MAP_HUGETLB;

what's the reason to take 'flags & MAP_HUGETLB' out of is_anon_memory?

jirka

>  		vdso = is_vdso_map(filename);
>  		no_dso = is_no_dso_memory(filename);
>  		map->prot = prot;
> diff --git a/tools/perf/util/map.h b/tools/perf/util/map.h
> index c2f5d28fe73a..b1c0686db1b7 100644
> --- a/tools/perf/util/map.h
> +++ b/tools/perf/util/map.h
> @@ -171,4 +171,18 @@ static inline bool is_bpf_image(const char *name)
>  	return strncmp(name, "bpf_trampoline_", sizeof("bpf_trampoline_") - 1) == 0 ||
>  	       strncmp(name, "bpf_dispatcher_", sizeof("bpf_dispatcher_") - 1) == 0;
>  }
> +
> +static inline int is_anon_memory(const char *filename)
> +{
> +	return !strcmp(filename, "//anon") ||
> +	       !strncmp(filename, "/dev/zero", sizeof("/dev/zero") - 1) ||
> +	       !strncmp(filename, "/anon_hugepage", sizeof("/anon_hugepage") - 1);
> +}
> +
> +static inline int is_no_dso_memory(const char *filename)
> +{
> +	return !strncmp(filename, "[stack", 6) ||
> +	       !strncmp(filename, "/SYSV", 5)  ||
> +	       !strcmp(filename, "[heap]");
> +}
>  #endif /* __PERF_MAP_H */
> -- 
> 2.28.0.681.g6f77f65b4e-goog
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ