can I input a gate service to kernel to get kernel data to user ?
is there method for doing this work? take kernel data to user? thanks!
On Thu, Dec 13, 2012 at 5:17 AM, horse_rivers <horse_rivers@126.com> wrote:
is there method for doing this work? take kernel data to user?
Check copy_to_user [1]. thanks, Daniel. [1] http://lxr.linux.no/#linux+v3.7/arch/x86/lib/usercopy_32.c#L715
At 2012-12-13 18:11:24,"Daniel Baluta" <daniel.baluta@gmail.com> wrote:
On Thu, Dec 13, 2012 at 5:17 AM, horse_rivers <horse_rivers@126.com> wrote:
is there method for doing this work? take kernel data to user?
Check copy_to_user [1].
how can user application achive to getting data from kernel , I have no idea about procedure for implementing this quest is there some advice ? BestRegards!
thanks, Daniel.
[1] http://lxr.linux.no/#linux+v3.7/arch/x86/lib/usercopy_32.c#L715
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
On 12/13/2012 04:17 AM, horse_rivers wrote:
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 Cheers, Matthias
thanks!
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
At 2012-12-13 18:52:53,"Matthias Brugger" <matthias.bgg@gmail.com> wrote:
On 12/13/2012 04:17 AM, horse_rivers wrote:
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 ? BestRegards!
Cheers, Matthias
thanks!
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Hi, On 12/14/2012 01:53 AM, horse_rivers wrote:
At 2012-12-13 18:52:53,"Matthias Brugger" <matthias.bgg@gmail.com> wrote:
On 12/13/2012 04:17 AM, horse_rivers wrote:
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!
Cheers, Matthias
thanks!
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
participants (3)
-
Daniel Baluta -
horse_rivers -
Matthias Brugger