kdb
[Top] [All Lists]

Re: Announce: kdb v4.4 is available for kernel 2.6.10

To: Keith Owens <kaos@xxxxxxx>
Subject: Re: Announce: kdb v4.4 is available for kernel 2.6.10
From: Paulo Marques <pmarques@xxxxxxxxxxxx>
Date: Mon, 27 Dec 2004 13:00:34 +0000
Cc: kdb@xxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx
In-reply-to: <18921.1103977059@xxxxxxxxxxxxxxx>
Organization: Grupo PIE
References: <18921.1103977059@xxxxxxxxxxxxxxx>
Sender: kdb-bounce@xxxxxxxxxxx
User-agent: Mozilla Thunderbird 0.7.1 (X11/20040626)
Keith Owens wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> KDB (Linux Kernel Debugger) has been updated.

Hi,

I browsed the patch quickly to check for kallsyms uses, and validate 
them, and it generally seems correct.

There is however one comment that makes me wonder:
*2.6 kallsyms has a "feature" where it unpacks the name into a string.
*If that string is reused before the caller expects it then the caller
*sees its string change without warning.

kallsyms_lookup always uses the buffer passed to it in the case the 
symbol is a kernel symbol, as opposed to a module symbol, and so it is 
not responsible for the buffer.

So this probably only happens when a module symbol is returned directly 
from its symbol table, and then the module is unloaded (or something 
like that).

Later there is another comment:
* Another 2.6 kallsyms "feature".  Sometimes the sym_name is
* set but the buffer passed into kallsyms_lookup is not used,
* so it contains garbage.

It seems to be the same problem. If we modify kallsyms_lookup to always 
use the buffer passed, even if the symbol comes from a module, maybe we 
could solve both problems with just one change.

On the downside, a caller that just wants to print the name, would pay 
an unnecessary string copy.

On the upside, this would make the interface more coherent with standard 
C functions like strcpy, where the buffer passed is always the buffer 
returned.

So, is it worth the change?

-- 
Paulo Marques - www.grupopie.com

"A journey of a thousand miles begins with a single step."
Lao-tzu, The Way of Lao-tzu

---------------------------
Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe.
<Prev in Thread] Current Thread [Next in Thread>