misc/166921: Use after free in dtrace(1) error handling

Ryan Stone rstone at FreeBSD.org
Fri Apr 13 21:40:06 UTC 2012


>Number:         166921
>Category:       misc
>Synopsis:       Use after free in dtrace(1) error handling
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Apr 13 21:40:06 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Ryan Stone
>Release:        8-STABLE
>Organization:
>Environment:
>Description:
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:

https://bitbucket.org/rysto32/valgrind-freebsd
>How-To-Repeat:

>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list