public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug testsuite/15625] New: unprivileged_embedded_C test confused by stub registers.stp
@ 2013-06-13 23:41 jkenisto at us dot ibm.com
  2013-06-13 23:46 ` [Bug testsuite/15625] " jkenisto at us dot ibm.com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: jkenisto at us dot ibm.com @ 2013-06-13 23:41 UTC (permalink / raw)
  To: systemtap

http://sourceware.org/bugzilla/show_bug.cgi?id=15625

            Bug ID: 15625
           Summary: unprivileged_embedded_C test confused by stub
                    registers.stp
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: testsuite
          Assignee: systemtap at sourceware dot org
          Reporter: jkenisto at us dot ibm.com

When running the systemtap.unprivileged/unprivileged_embedded_C.exp test, I see
the following failure:
...
testing s64_arg (long);no embedded C
testing u64_arg (long);no embedded C
testing asmlinkage();no embedded C
testing fastcall();no embedded C
testing regparm(long);no embedded C
eval exec stap -p2 --privilege=stapusr -e {probe begin { regparm(0) }}
semantic error: function may not be used when --privilege=stapusr is specified:
identifier 'regparm' at /usr/share/systemtap/tapset/i386/registers.stp:245:10
        source: function regparm(n:long) %{
                         ^

Pass 2: analysis failed.  Try again with another '--vp 01' option.
funcname is regparm
FAIL: unprivileged embedded C: no embedded C: --privilege=stapusr:
regparm(long)

stap correctly detects that regparm() in tapset/i386/registers.stp uses
embedded C,** but the test is looking at tapset/registers.stp, which contains
only stub functions with no embedded C.

A fix is to have the test ignore the stub registers.stp.

**Should the functions in registers.stp be marked unprivileged?  They provide
read-only access to CPU registers and function args.

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug testsuite/15625] unprivileged_embedded_C test confused by stub registers.stp
  2013-06-13 23:41 [Bug testsuite/15625] New: unprivileged_embedded_C test confused by stub registers.stp jkenisto at us dot ibm.com
@ 2013-06-13 23:46 ` jkenisto at us dot ibm.com
  2013-06-13 23:53 ` jistone at redhat dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: jkenisto at us dot ibm.com @ 2013-06-13 23:46 UTC (permalink / raw)
  To: systemtap

http://sourceware.org/bugzilla/show_bug.cgi?id=15625

--- Comment #1 from Jim Keniston <jkenisto at us dot ibm.com> ---
Created attachment 7078
  --> http://sourceware.org/bugzilla/attachment.cgi?id=7078&action=edit
Make embeddedc.awk skip over stub registers.stp

This patch seems to do the trick.

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug testsuite/15625] unprivileged_embedded_C test confused by stub registers.stp
  2013-06-13 23:41 [Bug testsuite/15625] New: unprivileged_embedded_C test confused by stub registers.stp jkenisto at us dot ibm.com
  2013-06-13 23:46 ` [Bug testsuite/15625] " jkenisto at us dot ibm.com
@ 2013-06-13 23:53 ` jistone at redhat dot com
  2013-06-14  0:09 ` fche at redhat dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: jistone at redhat dot com @ 2013-06-13 23:53 UTC (permalink / raw)
  To: systemtap

http://sourceware.org/bugzilla/show_bug.cgi?id=15625

Josh Stone <jistone at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jistone at redhat dot com

--- Comment #2 from Josh Stone <jistone at redhat dot com> ---
(In reply to Jim Keniston from comment #0)
> **Should the functions in registers.stp be marked unprivileged?  They
> provide read-only access to CPU registers and function args.

Unprivileged functions shouldn't leak kernel info though, so these functions
would need to restrict themselves to CONTEXT->uregs in this mode, and only for
one's own processes.

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug testsuite/15625] unprivileged_embedded_C test confused by stub registers.stp
  2013-06-13 23:41 [Bug testsuite/15625] New: unprivileged_embedded_C test confused by stub registers.stp jkenisto at us dot ibm.com
  2013-06-13 23:46 ` [Bug testsuite/15625] " jkenisto at us dot ibm.com
  2013-06-13 23:53 ` jistone at redhat dot com
@ 2013-06-14  0:09 ` fche at redhat dot com
  2013-06-17 19:20 ` brolley at redhat dot com
  2013-06-17 19:20 ` brolley at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: fche at redhat dot com @ 2013-06-14  0:09 UTC (permalink / raw)
  To: systemtap

http://sourceware.org/bugzilla/show_bug.cgi?id=15625

Frank Ch. Eigler <fche at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fche at redhat dot com

--- Comment #3 from Frank Ch. Eigler <fche at redhat dot com> ---
Considering that unprivileged mode probes do not include kprobes or similar
kernel-internal facilities, it may be sufficient to mark these register.stp
tapset functions /* myproc-unprivileged */ (to check process ownership).

As a belt-and-suspenders kind of thing, _stp_arg() could get a
STP_PRIVILEGE-level test to permit access to CONTEXT->regs (the
non-user-space one) only to stapsys/stapdev users.

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug testsuite/15625] unprivileged_embedded_C test confused by stub registers.stp
  2013-06-13 23:41 [Bug testsuite/15625] New: unprivileged_embedded_C test confused by stub registers.stp jkenisto at us dot ibm.com
                   ` (2 preceding siblings ...)
  2013-06-14  0:09 ` fche at redhat dot com
@ 2013-06-17 19:20 ` brolley at redhat dot com
  2013-06-17 19:20 ` brolley at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: brolley at redhat dot com @ 2013-06-17 19:20 UTC (permalink / raw)
  To: systemtap

http://sourceware.org/bugzilla/show_bug.cgi?id=15625

Dave Brolley <brolley at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|systemtap at sourceware dot org    |brolley at redhat dot com

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug testsuite/15625] unprivileged_embedded_C test confused by stub registers.stp
  2013-06-13 23:41 [Bug testsuite/15625] New: unprivileged_embedded_C test confused by stub registers.stp jkenisto at us dot ibm.com
                   ` (3 preceding siblings ...)
  2013-06-17 19:20 ` brolley at redhat dot com
@ 2013-06-17 19:20 ` brolley at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: brolley at redhat dot com @ 2013-06-17 19:20 UTC (permalink / raw)
  To: systemtap

http://sourceware.org/bugzilla/show_bug.cgi?id=15625

Dave Brolley <brolley at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |brolley at redhat dot com

--- Comment #4 from Dave Brolley <brolley at redhat dot com> ---
(In reply to Jim Keniston from comment #1)
> Created attachment 7078 [details]
> Make embeddedc.awk skip over stub registers.stp
> 
> This patch seems to do the trick.

The proper and more general solution for this is to fix embeddedc.awk so that
it does not analyse stub functions. Skipping entire files is too granular.

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-06-17 19:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-13 23:41 [Bug testsuite/15625] New: unprivileged_embedded_C test confused by stub registers.stp jkenisto at us dot ibm.com
2013-06-13 23:46 ` [Bug testsuite/15625] " jkenisto at us dot ibm.com
2013-06-13 23:53 ` jistone at redhat dot com
2013-06-14  0:09 ` fche at redhat dot com
2013-06-17 19:20 ` brolley at redhat dot com
2013-06-17 19:20 ` brolley at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).