Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Jun 2009 11:13:25 +0300
From:      Andriy Gapon <avg@icyb.net.ua>
To:        Thomas Backman <serenity@exscape.org>
Cc:        Alan Cox <alc@freebsd.org>, John Birrell <jb@freebsd.org>, FreeBSD current <freebsd-current@freebsd.org>, Alan Cox <alc@cs.rice.edu>
Subject:   Re: DTrace panic while probing syscall::open (and possibly many  others)
Message-ID:  <4A3C9A25.8050305@icyb.net.ua>
In-Reply-To: <F55615D8-8AE3-41C6-BD2F-0DB911918465@exscape.org>
References:  <949B5884-5303-4EFF-AC7D-293640FFA012@exscape.org>	<0C235698-3ED2-4AE9-A7D1-5DC56D8324A4@exscape.org>	<200905212129.47892.mel.flynn%2Bfbsd.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> <B2F32C8F-810B-4EA5-9E34-39ADD5E5CED4@exscape.org> <4A3A1D27.4010802@icyb.net.ua> <DD13EADF-CE41-465A-8D70-53DCDEFD65A7@exscape.org> <4A3BBF5A.6060702@icyb.net.ua> <4A3BC481.1010600@cs.rice.edu> <F72EDBE7-9A0A-44AB-AF58-23CE34CC93A0@exscape.org> <F55615D8-8AE3-41C6-BD2F-0DB911918465@exscape.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4A3C9A25.8050305>