From owner-freebsd-bugs@FreeBSD.ORG Fri Apr 13 21:40:06 2012 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B0B8F1065674 for ; Fri, 13 Apr 2012 21:40:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 71B7E8FC1A for ; Fri, 13 Apr 2012 21:40:06 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q3DLe6U1066325 for ; Fri, 13 Apr 2012 21:40:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q3DLe6m7066324; Fri, 13 Apr 2012 21:40:06 GMT (envelope-from gnats) Resent-Date: Fri, 13 Apr 2012 21:40:06 GMT Resent-Message-Id: <201204132140.q3DLe6m7066324@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Ryan Stone Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2A8D106564A for ; Fri, 13 Apr 2012 21:31:57 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 9F7398FC0A for ; Fri, 13 Apr 2012 21:31:57 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q3DLVv0B060359 for ; Fri, 13 Apr 2012 21:31:57 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id q3DLVvG5060358; Fri, 13 Apr 2012 21:31:57 GMT (envelope-from nobody) Message-Id: <201204132131.q3DLVvG5060358@red.freebsd.org> Date: Fri, 13 Apr 2012 21:31:57 GMT From: Ryan Stone To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: misc/166921: Use after free in dtrace(1) error handling X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2012 21:40:06 -0000 >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 -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: