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-unwind.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-unwind.stp')
-rw-r--r-- | tapset/ucontext-unwind.stp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tapset/ucontext-unwind.stp b/tapset/ucontext-unwind.stp index df275d4b..e1a8ade3 100644 --- a/tapset/ucontext-unwind.stp +++ b/tapset/ucontext-unwind.stp @@ -24,7 +24,8 @@ * Equivalent to <command>print_ustack(ubacktrace())</command>, * except that deeper stack nesting may be supported. Return nothing. */ -function print_ubacktrace () %{ +function print_ubacktrace () %{ /* unprivileged */ + assert_is_myproc(); if (CONTEXT->regs) { _stp_stack_print(CONTEXT->regs, 1, CONTEXT->pi, MAXTRACE, current); @@ -41,7 +42,8 @@ function print_ubacktrace () %{ * string length. Returns empty string when current probe point cannot * determine user backtrace. */ -function ubacktrace:string () %{ /* pure */ +function ubacktrace:string () %{ /* pure */ /* unprivileged */ + assert_is_myproc(); if (CONTEXT->regs) _stp_stack_snprint (THIS->__retvalue, MAXSTRINGLEN, CONTEXT->regs, 0, CONTEXT->pi, MAXTRACE, |