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] [day] [month] [year] [list]
Date:	Fri, 05 Apr 2013 17:20:56 +0900
From:	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
To:	Namhyung Kim <namhyung@...nel.org>
Cc:	Arnaldo Carvalho de Melo <acme@...stprotocols.net>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Paul Mackerras <paulus@...ba.org>,
	Ingo Molnar <mingo@...nel.org>,
	Namhyung Kim <namhyung.kim@....com>,
	LKML <linux-kernel@...r.kernel.org>,
	OSDepend <osdepend@...il.com>,
	"yrl.pp-manager.tt@...achi.com" <yrl.pp-manager.tt@...achi.com>
Subject: Re: [PATCH] perf probe: Enhance error message on non-kprobeable
 functions

(2013/04/05 11:39), Namhyung Kim wrote:
> From: Namhyung Kim <namhyung.kim@....com>
> 
> Some of kernel functions are not allowed to be used by kprobes for
> some reason, so they're marked as __kprobe on the source code and
> reside on ".kprobes.text" section.
> 
> However normal users which only see /proc/kallsyms don't know about
> them and would get only general error message when tried to add a
> probe on such function.

Right,

> 
>   $ sudo ./perf probe do_page_fault
>   Failed to find path of kernel module.
>   Added new event:
>   Failed to write event: Invalid argument
>     Error: Failed to add events. (-1)
> 
> This patch enhance it by checking the special kprobes section address
> and if to-be-probed function address is in the section, it would print
> like this:
> 
>   $ sudo ./perf probe do_page_fault
>   Failed to find path of kernel module.
>   Added new event:
>   Failed to write event: kprobes is not allowed for this function.
>     Error: Failed to add events. (-1)

Yeah, I agree that it is hard to know for perf probe users.
However, your implementation strongly depends on the current kernel,
I think we'd better export __kprobe_text_* as macros of symbol strings
in kprobes.h, and reuse it.
Or, export such no-probe symbols via /sys/kernel/debug/kprobes/noprobe_syms

Thank you,


-- 
Masami HIRAMATSU
IT Management Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@...achi.com


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