Bug 20298 - the unprivileged_embedded_C.exp testcase needs updating
Summary: the unprivileged_embedded_C.exp testcase needs updating
Status: RESOLVED FIXED
Alias: None
Product: systemtap
Classification: Unclassified
Component: testsuite (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-24 18:09 UTC by David Smith
Modified: 2016-06-27 17:57 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Smith 2016-06-24 18:09:58 UTC
There are at least 2 problems I see with testsuite/systemtap.stress/unprivileged_embedded_C.exp:

1) It only searches tapset functions in tapset/ and tapset/${ARCH}/. It doesn't search tapsets in tapset/linux/ and tapset/linux/${ARCH}/. It needs to be updated for the dyninst/linux tapset directory rearrangement.

2) It gets spurious failures. It assumes that if a tapset function doesn't have any embedded C (i.e. a pure stap script function), a unprivileged user can call it. That isn't the case if that pure stap script function calls a function that is privileged.

For example, note the following 2 functions from tapset/linux/conversions.exp:

====
function kernel_string:string (addr:long) %{ /* pure */                         
 ...
%}

function kernel_string:string (addr:long, err_msg:string) {                     
  try { return kernel_string(addr) } catch { return err_msg }                   
}                                                                               

====

If unprivileged_embedded_C.exp tests the 2nd function above, it will think an unprivileged user should be able to call it. However, since it calls the 1st function which is privileged, the 2nd function is also privileged.

Since the testcase can't know what pure stap script functions should be privileged or unprivileged, it should probably just skip testing them.
Comment 1 David Smith 2016-06-27 17:57:40 UTC
Fixed in commit ec0920c.