Re: Verify Kernel Pointer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Helo Talib ...

> A kernel virtual address is passed to my module. In order to avoid
> any chances of a crash, how can I verify  this pointer is pointing to
> a mapped memory location.

One thing that concerns me is, what if the passed pointer is pointing to 
ZONE_HIGHMEM memory pool?? IIRC, ZONE_HIGHMEM pages aren't statically 
mapped into the >3 GB virtual address.

Thus as a solution, instead of passing address of kernel memory, I 
suggest to pass the address of related page_struct. Then, from here, 
you can do kmap().

I hope I give you a correct suggestion, Talib...

regards,

Mulyadi


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux