A kernel module is a run-time loadable object file that is loaded into operating system kernel to add functionality to a running kernel. Examples include device drivers and other kernel items.
Questions tagged [kernel-module]
2228 questions
0
votes
1 answer
Do all kernel mode drivers and the Windows kernel share the same virtual address space?
As the subject states I would like to know whether there is a single virtual address space for the Windows kernel and all kernel mode drivers ? So basically a kernel mode driver has access to all Windows kernel data structures ?

JoeT
- 27
- 8
0
votes
1 answer
Which ETHREAD data member provides starting address (start of code) of the current executing thread?
Can someone tell me which data member of the ETHREAD structure that provides the starting address of the current executing thread ? Would it be the StartAddress data member as seen in the following dump ? I am looking for beginning address of the…

JoeT
- 27
- 8
0
votes
1 answer
How to cross-compile ARM version of LKM?
I need to perform MITM attack on a router, which is embedded linux system and its architecture is ARM. The linux kernel is 2.4.24. By MITM attack I mean intercept the packet, reedit it and send it forward. I want to use netfilter. But when I try…

SwordWorth
- 39
- 2
0
votes
1 answer
Can't get multi files kernel module to work
I'm trying to build a loadable kernel module using multiple source files. According to section 3.3 of https://www.kernel.org/doc/Documentation/kbuild/makefiles.txt I've got to use obj-m for main object file and modulename-y for the rest of…

Roman
- 1,396
- 4
- 15
- 39
0
votes
1 answer
SeedLabs Firewall Lab: Implement a Simple Kernel Module, failure to build a kernel module
I'm following the steps from here at 3.1 Task 1.A: Implement a Simple Kernel Module:
https://seedsecuritylabs.org/Labs_20.04/Files/Firewall/Firewall.pdf
Everything was fine until I ran the make command. the hello.ko file wasn't generated and I don't…

noob123
- 3
- 2
0
votes
1 answer
How to find out who loads specific Linux kernel module?
I built a certain driver as module (m) for Linux, the spi-imx by NXP. Nontheless, Linux probes this driver when booting. I'm struggling to find out what process/other module/driver requests this spi-imx driver. A depmod does not show any…

Tau Pi
- 55
- 5
0
votes
1 answer
I faced problem while compiling kernel module
Error: *** No rule to make target 'Home' Stop
There how I wrote my Makefile:
obj-m += hello-1.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build…
0
votes
0 answers
Unable to read from the device created by device driver
In a project of mine, I have decided to try making a device that can simulate dice rolls. For this, I have written the following kernel module.
//dicedriver.c
#include
#include
#include
#include…

nwlynx
- 1
0
votes
0 answers
How to read a certain entry with kernel module
I wanted to create two entries in /proc through the kernel module; So, when the user reads either of them, some different output is printed from each of them.
e.g:
cat /proc/entry1
>>>Hello World
cat /proc/entry2
>>> Goodbye World
Here's what i…

Amin
- 7
- 3
0
votes
0 answers
Cannot compile source for driver on SLES15 SP3
I have a similar issue to #68416356 with a driver that cannot compile on SLES15 SP3 (kernel 5.3.18-59.16. I am not a developer and I don't know C++.
See Compiling wanpipe driver on kernel 5.11
Any help would be highly appreciated.
make -C…

JoeyM
- 1
- 1
0
votes
0 answers
Unable to build with an old kernel branch. Seems to take the most recent one each time
I'm under Mint.
I want to build ufs kernel module for the kernel "4.15.0-54-generic" (to add write support).
Here my version :
~$ uname -a
> Linux user-virtual-machine 4.15.0-54-generic #58-Ubuntu SMP Mon Jun 24 10:55:24 UTC 2019 x86_64 x86_64…

Balobiana
- 36
- 5
0
votes
0 answers
Read From A Device in Kernel Module
Is it possible to read from a device in a kernel module? For example if I wanted to read from /dev/sda how would I go about doing that (I picked /dev/sda just as an example, in my exact scenario I need to read from a character device)? I know user…

Harry Muscle
- 2,247
- 4
- 38
- 62
0
votes
0 answers
Generate a CPU soft lockup with a user space process
I want to generate a CPU soft lockup to learn debugging crashes. How can I create a CPU soft lockup with a userspace C program in 4.15.0-142-generic #146~16.04.1-Ubuntu SMP X86_64 platform?

Franc
- 319
- 9
- 28
0
votes
1 answer
Build .ko file from .c file using GCC command line
As a learning exercise, I'm trying to build a kernel object file from a c file which would only do printk("hello, world") when loaded with modprobe. My kernel version is 4.15.
So let's say I have this example code:
int printk(const char *fmt,…

sashoalm
- 75,001
- 122
- 434
- 781
0
votes
0 answers
How to read a text file from Linux Kernel Module (Linux Kernel 5.11.0)
I want to read a txt file and write another txt file in kernel module
How should I do ?
I have seen many website.
It seems like it has many ways to solve this question
ex : filp_read() or kernel_read() or vfs_read()
[Sloved] But I have tried many…

jackson
- 11
- 3
- 9