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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20150323110228.GC21860@krava.brq.redhat.com>
Date:	Mon, 23 Mar 2015 12:02:28 +0100
From:	Jiri Olsa <jolsa@...hat.com>
To:	Namhyung Kim <namhyung@...nel.org>
Cc:	Arnaldo Carvalho de Melo <acme@...hat.com>,
	Jiri Olsa <jolsa@...nel.org>, linux-kernel@...r.kernel.org,
	Adrian Hunter <adrian.hunter@...el.com>,
	Corey Ashford <cjashfor@...ux.vnet.ibm.com>,
	David Ahern <dsahern@...il.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Ingo Molnar <mingo@...nel.org>,
	Paul Mackerras <paulus@...ba.org>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Stephane Eranian <eranian@...gle.com>, acme@...nel.org
Subject: Re: [PATCH 08/14] perf tools: Use kmod_path__parse in
 map_groups__set_modules_path_dir

On Mon, Mar 23, 2015 at 08:55:09AM +0900, Namhyung Kim wrote:

SNIP

> > > +	 */
> > > +	if (m->comp && is_kmod_dso(map->dso))
> > > +		map->dso->symtab_type++;
> > 
> > Ouch, does this assumes this is a:
> > 
> > DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE
> 
> Nope, it's one of _SYSTEM_PATH_KMODULE or _GUEST_KMODULE.
> 
> 
> > 
> > And that, because in the dso_binary_type enum
> > DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE_COMP comes right after it, and thus
> > this cryptic increment is equivalent to:
> > 
> > 		map->dso->symtab_type = DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE_COMP;
> 
> Again, _SYSTEM_PATH_KMODULE_COMP or _GUEST_KMODULE_COMP.
> 

yep, the code assumes (correctly) that symtab_type is
either _SYSTEM_PATH_KMODULE or _GUEST_KMODULE.

Namhyung placed the _COMP enum right behind 'no comp' values:

enum dso_binary_type {
	...
        DSO_BINARY_TYPE__GUEST_KMODULE,
        DSO_BINARY_TYPE__GUEST_KMODULE_COMP,
        DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE,
        DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE_COMP,
	...

so we could safely just increase the symtab_type in case
we detect it's compressed kernel module.

Perhaps the code could be more verbose on this, but since such
comment wasn't part of the previous code I did not feel the need
to add it now ;-)

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