Bug 10258

Summary: procfs probes should not put strings on kernel stack
Product: systemtap Reporter: Frank Ch. Eigler <fche>
Component: translatorAssignee: David Smith <dsmith>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:

Description Frank Ch. Eigler 2009-06-10 15:17:41 UTC
The implementation of _st_procfs_{read,write} use a string_t
temporary on the ordinary stack (strdata).  It must not do
that, since MAXSTRINGLEN could be large enough to overflow the
kernel stack, which may or may not be suspected/detected at compile
time.

Rather, such stuff needs to go into the context directly.

stap -DMAXSTRINGLEN=16384 -e ' { probe procfs("foo").write { log($value) }'
Comment 1 David Smith 2009-07-02 20:41:42 UTC
Fixed in commit 8e0049e.  Now procfs probes (read or write) do not put strings
on the kernel stack.
Comment 2 David Smith 2009-07-02 20:43:16 UTC
Resolved.