Re: Verify Kernel Pointer

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

 



Hi



Driver (i.e. my code) allocate memory for each request (through slab cache).
There could be many transections for each request. (think if you open a for
file you can do read, write operations).

As Bob said, you should probably consider using file structure for this.

And all I want to make sure that application (by mistake or by choice) is
not passing a junk value to my code. Once, I verify that memory is OK, than
I can look for signatures to make sure that it is pointing to correct data
structure.

If I've interpreted the above correctly all that you need to do is to verify whether
the address passed falls in the kernel address space or not. For that the simple
st of checks that you can do is to see whether the pointer is >PAGE_OFFSET.

Anand

Talib

_________________________________________________________________
On the road to retirement? Check out MSN Life Events for advice on how to
get there! http://lifeevents.msn.com/category.aspx?cid=Retirement



[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