diff options
author | Frank Ch. Eigler <fche@elastic.org> | 2009-09-16 22:32:28 -0400 |
---|---|---|
committer | Frank Ch. Eigler <fche@elastic.org> | 2009-09-16 22:37:24 -0400 |
commit | 6ecd877049008c5abe9c6720ea8fc64732f47eb5 (patch) | |
tree | 407a536c1271b8e5757899e461c481e599266d67 /tapset/ucontext-symbols.stp | |
parent | 6846cfc8a5cdb24fccb19037b27a180d2300ee09 (diff) | |
download | systemtap-steved-6ecd877049008c5abe9c6720ea8fc64732f47eb5.tar.gz systemtap-steved-6ecd877049008c5abe9c6720ea8fc64732f47eb5.tar.xz systemtap-steved-6ecd877049008c5abe9c6720ea8fc64732f47eb5.zip |
PR10650: markup some unprivileged-safe tapset functions
Add /* unprivileged */ to a variety of tapset embedded-c functions,
together with uid-assertion-checking code as needed. This is only
an initial set, and may need to grow or shrink after further testing.
Prototyped-By: Dave Brolley <brolley@redhat.com>
* runtime/runtime.h (is_myproc, assert_is_myproc): New macros.
* runtime/addr-map.c (lookup_bad_addr): Reject if !is_myproc
in unprivileged mode.
* runtime/print.c (_stp_print_kernel_info): Add unprivileged
mode info.
* tapset/DEVGUIDE: Document /* pure */ and /* unprivileged */.
* tapset/*.stp: Add /* unprivileged */ here and there, in
questionable cases along with an assert_is_myproc().
Diffstat (limited to 'tapset/ucontext-symbols.stp')
-rw-r--r-- | tapset/ucontext-symbols.stp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tapset/ucontext-symbols.stp b/tapset/ucontext-symbols.stp index 7fed71d2..e884a36b 100644 --- a/tapset/ucontext-symbols.stp +++ b/tapset/ucontext-symbols.stp @@ -46,7 +46,8 @@ function usymname:string (addr: long) %{ /* pure */ * will be omitted and if the symbol name is unknown it will return the * hex string for the given address. */ -function usymdata:string (addr: long) %{ /* pure */ +function usymdata:string (addr: long) %{ /* pure */ /* unprivileged */ + assert_is_myproc(); _stp_symbol_snprint(THIS->__retvalue, MAXSTRINGLEN, THIS->addr, current, 1); %} @@ -63,9 +64,10 @@ function usymdata:string (addr: long) %{ /* pure */ * name of the function containing the address, and an estimate of * its position within that function. Return nothing. */ -function print_ustack(stk:string) %{ +function print_ustack(stk:string) %{ /* pure */ /* unprivileged */ char *ptr = THIS->stk; char *tok = strsep(&ptr, " "); + assert_is_myproc(); while (tok && *tok) { _stp_print_char(' '); _stp_usymbol_print (simple_strtol(tok, NULL, 16), current); |