DTrace panic while probing syscall::open (and possibly
many others)
Andriy Gapon
avg at freebsd.org
Wed Jun 24 13:17:08 UTC 2009
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
More information about the freebsd-current
mailing list