Zhibin Li's GSoC status report - #2 of 12

Dmitry V. Levin ldv at altlinux.org
Fri Jun 21 11:13:14 UTC 2019


On Wed, Jun 19, 2019 at 09:31:25AM +0800, Zhibin Li wrote:
> Just FYI I write a demo[1] of priv qualifier for -e inject.
> It can be used like:
> # strace -eioctl -e inject=ioctl:retval=42:priv=i915 ./a.out
> Basically it works as I expect but this is a experimental patch.
> The way it makes things work may be ugly so any commnets/suggestions are
> welcomed :).
> 
> [1]
> https://github.com/haoyouab/strace/commit/9c915fe7ed66f08b41b5d9c72e3d03b09c8ca9a3

Well, this is not even an injection into the tracee, it's an overwriting
of strace internal tcp->_priv_data with arbitrary data.

Yes, it's notoriously difficult to implement a positive testing of ioctl
decoders.  In this case you need to convince strace to enable i915-specific
decoder.
If you could subvert e.g. readlink("/sys/class/drm/null/device/driver", ...)
to return something that ends with /i915, this would be enough for
drm_is_driver(tcp, "i915") to return true.


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20190621/11197692/attachment.bin>


More information about the Strace-devel mailing list