Thread (6 messages) 6 messages, 3 authors, 2012-12-14

can I input a gate service to kernel to get kernel data to user ?

From: matthias.bgg@gmail.com (Matthias Brugger)
Date: 2012-12-14 09:28:35

Hi,

On 12/14/2012 01:53 AM, horse_rivers wrote:
At 2012-12-13 18:52:53,"Matthias Brugger" [off-list ref] wrote:
quoted
On 12/13/2012 04:17 AM, horse_rivers wrote:
quoted
  is there method for doing this work? take kernel data to user?
I think copy_to_user is what you are looking for:
http://lxr.free-electrons.com/source/include/asm-generic/uaccess.h#L253
thanks !

can this function run at user level ?

when programme is   at user level , can  I use this function to get kernel text segment data ,and then analysis it ?
no you can't. Userspace programs can only access the kernel trough a 
systemcall, otherwise userspace could read memory from other programs 
which would be dangerous (think of passwords etc).

If you want to read certain parts of kernel memory from userspace, you 
need a kernel module which uses copy_to_user, for example a character 
driver using the read or ioctl function to call copy_to_user.

The userspace then would use that character device to invoke systemcalls.

Please refer to http://lwn.net/Kernel/LDD3/ about device driver 
programing. Although the book is outdated it is a perfect point to start 
understanding the concepts.

Best regards,
Matthias
BestRegards!
quoted
Cheers,
Matthias
quoted

  thanks!

  _______________________________________________
  Kernelnewbies mailing list
  Kernelnewbies at kernelnewbies.org
  http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help