Fwd: proc_mem modification to allow use in timer probes

Frank Ch. Eigler fche@redhat.com
Mon Feb 15 16:09:00 GMT 2010


Mark Wielaard <mjw@redhat.com> writes:

> [...] Attached is a patch that adds proc_mem function variants that take a
> task (as returned by one of the task.stp tapset functions). [...]

(It's unfortunate to require even one embedded-c function for this.)

> I made the new functions /* pure */, since they return the same value
> when called from the same context, but not /* unprivileged */ since they
> could "leak" information about processes you don't own.

Sure.

> Although it seems /proc/<anypid>/statm is readable for anybody, so
> maybe they could be marked unprivileged? I would be slightly
> concerned that @cast/kread() could be fed an arbitrary address, that
> happens to look like a task struct, but in reality isn't and so
> would provide an information leak. [...]

When running in unprivileged mode, deref() (which @cast/kread
ultimately uses) is constrained at run time to user-space addresses.

- FChE



More information about the Systemtap mailing list