Skip to contentSkip to conversation

news about retrieving kernel symbols (tasklist_struct)

DISCUSSION Giacomo 2 participants 2 messages Sep 25, 2006 netfilter

lore
Share & tools
lore

Giacomo

author
#0 lore raw

Good afternoon.
As to the need to retrieve the symbol tasklist_lock, which is no more exported in kernel 2.6.18, i tried to use the

kallsyms_lookup_name("tasklist_lock");

function.

It returns an unsigned long which should be the address of the symbol, e.g. the variable tasklist_lock.

So i tried to use it, but it does not work!

-------------------------------------------------------------------
rwlock_t tasklist_lock_from_symbol;
unsigned long tlockptr;

tlockptr = kallsyms_lookup_name("tasklist_lock");

if( tlockptr == 0)

	return NULL;

printk("symbol: 0x%lx\n", tlockptr);

memcpy(&tasklist_lock_from_symbol, (void*) &tlockptr, sizeof(rwlock_t) );

read_lock(&tasklist_lock_from_symbol);
(...)
---------------------------------------------------------------------

Perhaps this is not the right way to retrieve the address of the variable...

thanks a lot

Signature · 20 lines
Giacomo S.
http://www.giacomos.it

- - - - - - - - - - - - - - - - - - - - - -

Proteggi il tuo PC provando il mio semplice FIREWALL:
http://www.giacomos.it/ipfire

mailto:
[email protected]
[email protected]
[email protected]

- - - - - - - - - - - - - - - - - - - - - -

. ''  `.
:   :'    :
`.  ` '
   `- Debian GNU/Linux -- The power of freedom
       http://www.debian.org
#1 lore raw
Quoted 3 lines · Giacomo

Good afternoon.
As to the need to retrieve the symbol tasklist_lock, which is no more exported in kernel 2.6.18, i tried to use the

There is a reason why it is not exported anymore. You can't use it from netfilter.