Quantcast
Channel: Active questions tagged kernel - Stack Overflow
Viewing all articles
Browse latest Browse all 6502

insmod: can't insert 'NetlinkRtLKM.ko': Out of memory

$
0
0

I have written a kernel module, compiling and insmod-ing it works perfect on my native linux machine running kernel 5.0.0-36-generic (running as VM).

Now, I want to compile and run the same kernel module for another kernel version 5.0.0. I have built the kernel version 5.0.0 and installed the kernel modules as below.

vm@ubuntu:/usr/lib/modules/5.0.0$ ls -l
total 52
lrwxrwxrwx 1 root root   32 Nov 24 09:02 build -> /home/vm/Documents/UML/linux-5.0
drwxr-xr-x 3 root root 4096 Nov 24 09:02 kernel
-rw-r--r-- 1 root root  566 Nov 24 09:02 modules.alias
-rw-r--r-- 1 root root 1205 Nov 24 09:02 modules.alias.bin
-rw-r--r-- 1 root root 4730 Nov 24 09:02 modules.builtin
-rw-r--r-- 1 root root 6949 Nov 24 09:02 modules.builtin.bin
-rw-r--r-- 1 root root  980 Nov 24 09:02 modules.dep
-rw-r--r-- 1 root root 1554 Nov 24 09:02 modules.dep.bin
-rw-r--r-- 1 root root    0 Nov 24 09:02 modules.devname
-rw-r--r-- 1 root root  552 Nov 24 09:02 modules.order
-rw-r--r-- 1 root root   55 Nov 24 09:02 modules.softdep
-rw-r--r-- 1 root root 1263 Nov 24 09:02 modules.symbols
-rw-r--r-- 1 root root 1357 Nov 24 09:02 modules.symbols.bin
lrwxrwxrwx 1 root root   32 Nov 24 09:02 source -> /home/vm/Documents/UML/linux-5.0
vm@ubuntu:/usr/lib/modules/5.0.0$

I have also updated the makefile to build LKM for right kernel version. Module compiles successfully, but while insmod-ing it into User Mode Linux running kernel 5.0.0., getting the error out of memory. WHAT AM I MISSING HERE !!

Makefile :
obj-m += NetlinkRtLKM.o
all:
    make -C /lib/modules/5.0.0/build ARCH=um M=$(PWD) modules
clean:
    make -C /lib/modules/5.0.0/build ARCH=um M=$(PWD) clean

Viewing all articles
Browse latest Browse all 6502

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>