Alfred Perlstein <[EMAIL PROTECTED]> on 28.01.2000 11:49:34

To:   Thomas Klein/Aachen/Utimaco/DE@utimaco
cc:   [EMAIL PROTECTED]

Subject:  Re: how to catch a wildrunning pointer






> >
> > Hi
> >
> > My Problem:
> > Within a kernel timeout routine I allocate memory and fill it with data.
> > After a while I lock at this data again and realize that it it was modifyted
> > (but not by me).
> > How can I set a kernel mode watch point to that data to see which function
> > change the data.
> >
> > Any Ideas ????
>
> Look at the vm code, you can probably write protect the pages while
> you aren't accessing them, this will cause offending code to panic
> the machine so you can figure out who is twiddling your bits.
>
> Of course you'll have to unprotect the memory when you want to access
> it for legitimate reasons.
>
> You owe the oracle a how-to on acually doing this, a paragraph or two
> would suffice.
>
> thanks,
> -Or^H^HAlfred


If I understand this correctly I have to use the pmap_protect function.

For testing I integrate the following sequence within a device driver
attach routine.

     {
          int i;
          char * t_ptr;

          t_ptr = (char*) malloc(1027,M_DEVBUF,M_NOWAIT);
          for(i=0;i<1027,i++)
               *t_ptr = 'x';
          pmap_protect(kmem_map,t_ptr,t_prt + 1027,VM_PROT_READ);
          *t_ptr = 'A';
          printf("I can see this\n");
     }

No exception ocured.
What is wrong?
Wy dosn't it work?

Regards Thomas






To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to