Bug 10258 - procfs probes should not put strings on kernel stack
Summary: procfs probes should not put strings on kernel stack
Status: RESOLVED FIXED
Alias: None
Product: systemtap
Classification: Unclassified
Component: translator (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: David Smith
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-10 15:17 UTC by Frank Ch. Eigler
Modified: 2009-07-02 20:43 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 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.