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:	Thu, 08 Feb 2007 17:16:15 +0530
From:	Srinivasa Ds <srinivasa@...ibm.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
CC:	Frederik Deweerdt <deweerdt@...e.fr>,
	Christoph Hellwig <hch@...radead.org>,
	linux-kernel@...r.kernel.org, torvalds@...ux-foundation.org,
	jkenisto@...ibm.com, anil.s.keshavamurthy@...el.com,
	prasanna@...ibm.com, ananth@...ibm.com
Subject: Re: [RFC] [PATCH] To list all active probes in the system---Take-2

Andrew Morton wrote:
> On Wed, 07 Feb 2007 10:55:23 +0530
> Srinivasa Ds <srinivasa@...ibm.com> wrote:
> 
>> --- linux-2.6.20.orig/fs/debugfs/inode.c
>> +++ linux-2.6.20/fs/debugfs/inode.c
>> @@ -25,6 +25,7 @@
>>  
>>  	if (retval)
>>  		subsystem_unregister(&debug_subsys);
>> +	debugfs_kprobe_init();
>>  	return retval;
>>  }
> 
> eww.  Didn't it feel bad when you did that?
> 
> 
> As this module has a dependency upon debugfs, I'd have thought the
> approproate way of expressing that would be to run debugfs_kprobe_init()
> at a lower initcall priority than debugfs_init()
> 
>> +
>> +	if (dir == NULL)
>> +		return;
>> +	debugfs_create_file("list", 0444, dir , 0 , &proc_kprobes_operations);
>> +}
>> +
>>  __initcall(init_kprobes);
> 
> debugfs_init() already runs at core_initcall level, presumably so that
> debugfs clients can use plain old module_init().
> 
>> +static inline void debugfs_kprobe_init(void)
>> +{
>> +}
> 
> In which case we don't need this.	

Updating the patch according to Andrew's comment.

  This patch lists all active probes in the system by scanning through
kprobe_table[]. It takes care of aggregate handlers and prints the type
of the probe.
Letter "k" for kprobes, "j" for jprobes, "r" for kretprobes. It also
lists address of the instruction,its symbolic name(function name +
offset) and the module name. One can access this file through
/sys/kernel/debug/kprobes/list.

Output looks like this
=====================
llm40:~/a # cat /sys/kernel/debug/kprobes/list
c0169ae3  r  sys_read+0x0
c0169ae3  k  sys_read+0x0
c01694c8  k  vfs_write+0x0
c0167d20  r  sys_open+0x0
f8e658a6  k  reiserfs_delete_inode+0x0  reiserfs
c0120f4a  k  do_fork+0x0
c0120f4a  j  do_fork+0x0
c0169b4a  r  sys_write+0x0
c0169b4a  k  sys_write+0x0
c0169622  r  vfs_read+0x0
=================================


Signed-off-by: Srinivasa DS <srinivasa@...ibm.com>



View attachment "list.patch" of type "text/x-patch" (3200 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ