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:	Fri, 30 Jan 2015 15:32:46 +0100
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>,
	LKML <linux-kernel@...r.kernel.org>,
	David Ahern <dsahern@...il.com>,
	Adrian Hunter <adrian.hunter@...el.com>,
	Andi Kleen <andi@...stfloor.org>,
	Stephane Eranian <eranian@...gle.com>,
	Frederic Weisbecker <fweisbec@...il.com>
Subject: Re: [PATCH 01/42] perf tools: Support to read compressed module from
 build-id cache

On Thu, Jan 29, 2015 at 05:06:42PM +0900, Namhyung Kim wrote:
> The commit c00c48fc6e6e ("perf symbols: Preparation for compressed
> kernel module support") added support for compressed kernel modules
> but it only supports system path DSOs.  When a dso is read from
> build-id cache, its filename doesn't end with ".gz" but has build-id.
> In this case, we should fallback to the original dso->name.
> 
> Signed-off-by: Namhyung Kim <namhyung@...nel.org>
> ---
>  tools/perf/util/symbol-elf.c | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
> index 06fcd1bf98b6..b24f9d8727a8 100644
> --- a/tools/perf/util/symbol-elf.c
> +++ b/tools/perf/util/symbol-elf.c
> @@ -574,13 +574,16 @@ static int decompress_kmodule(struct dso *dso, const char *name,
>  	const char *ext = strrchr(name, '.');
>  	char tmpbuf[] = "/tmp/perf-kmod-XXXXXX";
>  
> -	if ((type != DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE_COMP &&
> -	     type != DSO_BINARY_TYPE__GUEST_KMODULE_COMP) ||
> -	    type != dso->symtab_type)
> +	if (type != DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE_COMP &&
> +	    type != DSO_BINARY_TYPE__GUEST_KMODULE_COMP &&
> +	    type != DSO_BINARY_TYPE__BUILD_ID_CACHE)
>  		return -1;

hum, is it possible the type == DSO_BINARY_TYPE__BUILD_ID_CACHE could get in here?


---
        for (i = 0; i < DSO_BINARY_TYPE__SYMTAB_CNT; i++) {
                struct symsrc *ss = &ss_[ss_pos];
                bool next_slot = false;

                enum dso_binary_type symtab_type = binary_type_symtab[i];

                if (!dso__is_compatible_symtab_type(dso, kmod, symtab_type))
                        continue;

---		^^^ this check should rule out buildid symtab_type for kmod dso?

		symsrc__init(
			

I wonder wether we should set special type from compressed binaries (as of now),
or instead try to decompress anything that looks like it's compressed ;-)
it seems more to be more generic and could simplify the code..

jirka
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ