Date: Wed, 24 Jun 2009 16:17:02 +0300 From: Andriy Gapon <avg@freebsd.org> To: Wesley Shields <wxs@freebsd.org> Cc: Alan Cox <alc@freebsd.org>, John Birrell <jb@freebsd.org>, Thomas Backman <serenity@exscape.org>, FreeBSD current <freebsd-current@freebsd.org> Subject: Re: DTrace panic while probing syscall::open (and possibly many others) Message-ID: <4A42274E.2020207@freebsd.org> In-Reply-To: <20090624003531.GA63536@atarininja.org> References: <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> <20090624003531.GA63536@atarininja.org>
next in thread | previous in thread | raw e-mail | index | archive | help
on 24/06/2009 03:35 Wesley Shields said the following: > This patch makes it work for me and uses INKERNEL. I have no idea if > it's correct or not... > > Index: sys/cddl/dev/dtrace/amd64/dtrace_isa.c > =================================================================== > --- sys/cddl/dev/dtrace/amd64/dtrace_isa.c (revision 194740) > +++ sys/cddl/dev/dtrace/amd64/dtrace_isa.c (working copy) > @@ -524,9 +524,9 @@ > static int > dtrace_copycheck(uintptr_t uaddr, uintptr_t kaddr, size_t size) > { > - ASSERT(kaddr >= kernelbase && kaddr + size >= kaddr); > + ASSERT(INKERNEL(kaddr) && kaddr + size >= kaddr); > > - if (uaddr + size >= kernelbase || uaddr + size < uaddr) { > + if (INKERNEL(uaddr + size) || uaddr + size < uaddr) { > DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); > cpu_core[curcpu].cpuc_dtrace_illval = uaddr; > return (0); > > > I've put a copy up at http://people.freebsd.org/~wxs/dtrace.diff too. Wesley, thank you! I like this patch and I am sure that it does the right thing. I think that we should retire kernelbase from amd64 altogether and replace all other uses of it in dtrace_isa.c (uaddr checks) similarly to the above, and remove unused extern declaration in dtrace_subr.c too. -- Andriy Gapon
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4A42274E.2020207>