From owner-freebsd-current@FreeBSD.ORG Sat Jun 20 08:13:35 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C6311065673; Sat, 20 Jun 2009 08:13:35 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id E8E3A8FC0A; Sat, 20 Jun 2009 08:13:33 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id LAA15090; Sat, 20 Jun 2009 11:13:27 +0300 (EEST) (envelope-from avg@icyb.net.ua) Received: from localhost.topspin.kiev.ua ([127.0.0.1] helo=edge.pp.kiev.ua) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1MHvhW-000OVj-Mx; Sat, 20 Jun 2009 11:13:26 +0300 Message-ID: <4A3C9A25.8050305@icyb.net.ua> Date: Sat, 20 Jun 2009 11:13:25 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.21 (X11/20090406) MIME-Version: 1.0 To: Thomas Backman References: <949B5884-5303-4EFF-AC7D-293640FFA012@exscape.org> <0C235698-3ED2-4AE9-A7D1-5DC56D8324A4@exscape.org> <200905212129.47892.mel.flynn+fbsd.current@mailing.thruhere.net> <44F486FA-E798-448D-BE31-F7A51EF1F612@exscape.org> <60173AF0-7E54-4BDD-8927-0DADA9DAD1B4@exscape.org> <20090522200306.GE2630@atarininja.org> <20090617225849.GB28509@atarininja.org> <4A3A1D27.4010802@icyb.net.ua> <4A3BBF5A.6060702@icyb.net.ua> <4A3BC481.1010600@cs.rice.edu> In-Reply-To: X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Alan Cox , John Birrell , FreeBSD current , Alan Cox Subject: Re: DTrace panic while probing syscall::open (and possibly many others) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2009 08:13:35 -0000 on 19/06/2009 20:41 Thomas Backman said the following: > On Jun 19, 2009, at 07:32 PM, Thomas Backman wrote: >> Very interesting. >> I replaced the ASSERT line temporarily: >> >> --- >> ../src_r194478-UNTOUCHED/sys/cddl/dev/dtrace/amd64/dtrace_isa.c >> 2009-06-19 13:10:05.661079736 +0200 >> +++ sys/cddl/dev/dtrace/amd64/dtrace_isa.c 2009-06-19 >> 19:24:42.362125129 +0200 >> @@ -524,7 +524,7 @@ >> static int >> dtrace_copycheck(uintptr_t uaddr, uintptr_t kaddr, size_t size) >> { >> - ASSERT(kaddr >= kernelbase && kaddr + size >= kaddr); >> + ASSERT(kaddr >= 0xffffff8000000000 && kaddr + size >= kaddr); >> >> if (uaddr + size >= kernelbase || uaddr + size < uaddr) { >> DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); >> >> ... and it works! I obviously haven't tried it for extended periods or >> anything, but at least it's working so far. >> Should the ASSERT simply use this (as a #define somewhere) or the >> INKERNEL macro, though? I think that this should be sufficient, because I don't think that 'kaddr' of dtrace scratch buffer could be in direct map. > BTW... Should "kernelbase" in the line following the ASSERT also be > replaced, or not? As far as I can understand (not too far in these > contexts ;) it (should) check/s to see whether the userspace data, to be > copied, is inside the kernel *map*(?)... which at the moment, I guess it > doesn't. Correct? Yes, I think so too. -- Andriy Gapon