misc/166921: Use after free in dtrace(1) error handling
rstone at FreeBSD.org
Fri Apr 13 21:40:06 UTC 2012
>Synopsis: Use after free in dtrace(1) error handling
>Arrival-Date: Fri Apr 13 21:40:06 UTC 2012
>Originator: Ryan Stone
If I run dtrace(1) under valgrind (memcheck) and hit the "no probes matched" case, I sometimes see dtrace segfault. It would seem that one thread in dtrace frees memory while the other is still accessing it. If that memory is subsequently re-allocated dtrace crashes.
Running dtrace with MALLOC_OPTIONS=AJ would probably reproduce this easily.
I think that one sample invocation was something like dtrace -p <pid> -n 'pid$target:libc*:malloc:entry' (see reqst00307862 for the fact that this doesn't match a probe in the first place.
I think that this has the necessary syscalls implemented to run dtrace under valgrind:
More information about the freebsd-bugs