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>] [day] [month] [year] [list]
Date:	Thu, 07 Jan 2010 12:40:42 +0100
From:	Michal Marek <mmarek@...e.cz>
To:	Cheng Renquan <crquan@...il.com>
Cc:	linux-kbuild@...r.kernel.org, lkml <linux-kernel@...r.kernel.org>,
	Rusty Russell <rusty@...tcorp.com.au>
Subject: Re: [PATCH] kallsyms: skip kernel symbols when lookup in module

On 7.1.2010 07:43, Cheng Renquan wrote:
> kernel symbols lookup is expensive, when we know it's a lookup in module,
> we can skip the heavy kernel symbols.
> 
> Signed-off-by: Cheng Renquan <crquan@...il.com>
> ---
>  kernel/kallsyms.c |   12 ++++++++----
>  1 files changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c
> index 8e5288a..bb9fdc5 100644
> --- a/kernel/kallsyms.c
> +++ b/kernel/kallsyms.c
> @@ -173,12 +173,16 @@ unsigned long kallsyms_lookup_name(const char *name)
>  	unsigned long i;
>  	unsigned int off;
>  
> -	for (i = 0, off = 0; i < kallsyms_num_syms; i++) {
> -		off = kallsyms_expand_symbol(off, namebuf);
> +	/* if a colon ':' found, skip the heavy kernel symbols */
> +	if (strchr(name, ':') == NULL) {
> +		for (i = 0, off = 0; i < kallsyms_num_syms; i++) {
> +			off = kallsyms_expand_symbol(off, namebuf);
>  
> -		if (strcmp(namebuf, name) == 0)
> -			return kallsyms_addresses[i];
> +			if (strcmp(namebuf, name) == 0)
> +				return kallsyms_addresses[i];
> +		}
>  	}
> +
>  	return module_kallsyms_lookup_name(name);
>  }
>  EXPORT_SYMBOL_GPL(kallsyms_lookup_name);

It think Rusty is the right person to handle this (CC added). But if you
want my opinion: The patch looks ok.

Acked-by: Michal Marek <mmarek@...e.cz>

Michal
--
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