This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: BUG: sleeping function called from invalid context at kernel/rwsem.c:20
"Bryn M. Reeves" <breeves@redhat.com> writes:
> [...]
> > [...] I thought that __get_user would catch
> > faults, but maybe not...
>
> No - the __XXX versions do *not* do any checking themselves. This must
> be done by the caller with access_ok() first. [...]
> See arch/*/uaccess.h
The user-space access model for systemtap is somewhat convoluted.
Given that our probes may run from any old context and may not sleep,
they cannot do any exhaustive testing on user-space addresses before
trying to use them. So, we are counting on faults to be triggered
when e.g. paged-out or unmapped user-space pages are being accessed.
When that happens, the exception-fixup code in the systemtap runtime
is to attempt catching these, so an clean error can be returned to the
systemtap script.
- FChE