> -----Original Message----- > From: kernelnewbies-bounce@xxxxxxxxxxxx > [mailto:kernelnewbies-bounce@xxxxxxxxxxxx] On Behalf Of Gaurav Dhiman > Sent: Thursday, April 20, 2006 3:29 PM > To: Talib Alim > Cc: anandhkrishnan@xxxxxxxxx; kernelnewbies@xxxxxxxxxxxx > Subject: Re: Verify Kernel Pointer > > > On 4/20/06, Talib Alim <talibalm@xxxxxxxxxxx> wrote: > > My module pass back pointer to user application when device > is opened. > > From that point, user application request different > services from my > > module. > > > > In order to avoid any lookup overhead, kernel virtual pointer is > > passed back to user application. > > Kernel virtual address will not at all be accessable in user > space and not at all recommended. If you want to request > different services from driver, whydont u use IOCTL > mechanisum, define you ioclt command and use them. Kernel > virtual address are greater than 3G where as user can have > maximum virtual address as 3G, correct me if I am worng. > > Gaurav If I'm reading Talib's question correctly, it looks like he is treating the pointer as opaque in user space, i.e. not directly referencing the memory in user space, but he is passing the pointer back to his kernel module at some point in the future, and he wants to make sure that on this subsequent call the pointer is still valid. Without seeing his code and knowing exactly what he is trying to accomplish, I can't say for sure. Whatever the case, for saving opaque kernel pointers I would use the private_data field in the file structure, assuming this is a driver or virtual file system he is working with. Bob > > > > > Talib > > > > >On 4/20/06, Talib Alim <talibalm@xxxxxxxxxxx> wrote: > > > > 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. > > > > > >Can you elaborate more on this ? > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download > today - it's > > FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > > > > -- > -- > -Gaurav > Email: gauravd.chd@xxxxxxxxx > --------------------------------- > Read my blog at: http://lkdp.blogspot.com/ > --------------------------------- > > -- > Kernelnewbies: Help each other learn about the Linux kernel. > Archive: http://mail.nl.linux.org/kernelnewbies/ > FAQ: http://kernelnewbies.org/faq/ > > > -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/