kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* Getting netlink socket creation returns NULL in the kernel
@ 2019-10-16  4:54 Irfan Ullah (울라 이르판)
  2019-10-16 14:29 ` Valdis Klētnieks
  0 siblings, 1 reply; 4+ messages in thread
From: Irfan Ullah (울라 이르판) @ 2019-10-16  4:54 UTC (permalink / raw)
  To: kernelnewbies


[-- Attachment #1.1: Type: text/plain, Size: 1763 bytes --]

Dear All,
I am trying to implement prefetching using machine learning in the kernel.
I need some data from the kernel directly. In this regard I have got very
useful comment that

> Don't do that (directly).  Pass the data to userspace via netlink or
debugfs or shared
memory or other means, and have userspace handle it.

      I am trying to pass data to the kernel space using netlink.
Following this
link <https://gist.github.com/arunk-s/c897bb9d75a6c98733d6>, I have
developed kernel space, and user space programs.  Kernel and user space
programs working perfectly when I load and run these modules from the
terminal using “sudo insmod kernelmodule.ko”, and “./userspaceApp”
respectively.  But, when I try to use kernel program  (directly as a header
file #include "kernelmodule.h") with the kernel original file that is
“vmx.c” then it returns “NULL” while creating socket (nl_sk = NULL in nl_sk
= netlink_kernel_create(&init_net, NETLINK_USER, &cfg);) .  I call  user
defined function, i.e., create_socket(unsigned long int addr) of
kernelmodule.h from handle_ept_voilation() in vmx.c.
handle_ept_voilation()  is called when ept fault occurs in case of virtual
machine.
Furthermore,  I have observed one weird behaviour: if I put 1-3 seconds
sleep just before the socket creating statement , then it works just during
booting of my virtual machine, after successful boot I get the same socket
NULL error.
Thank you for your help.



-- 
*Best Regards,*


*Mr. Irfan Ullah*
PhD Candidate
Data and Knowledge Engineering(DKE) Lab
Department of Computer Science and Engineering
Kyung Hee University, South Korea.
 +82-010-591-51651 <+82%2010-3877-8867>
  sahibzada.iu@gmail.com
 sahibzada_irfanullah

[-- Attachment #1.2: Type: text/html, Size: 3721 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-10-22  8:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-16  4:54 Getting netlink socket creation returns NULL in the kernel Irfan Ullah (울라 이르판)
2019-10-16 14:29 ` Valdis Klētnieks
2019-10-17  6:23   ` Irfan Ullah (울라 이르판)
2019-10-22  8:31     ` Irfan Ullah (울라 이르판)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).