kvm: module verification failed: signature and/or required key missing – tainting kernel

Instead of re-configuring the kernel, this error (module verification failed) could be resolved by just adding one line CONFIG_MODULE_SIG=n to the top of the Makefile for the module itself: CONFIG_MODULE_SIG=n # If KERNELRELEASE is defined, we’ve been invoked from the # kernel build system and can use its language. ifneq ($(KERNELRELEASE),) obj-m := hello.o # … Read more

What is a Kernel thread?

A kernel thread is a task_struct with no userspace components. Besides the lack of userspace, it has different ancestors (kthreadd kernel thread instead of the init process) and is created by a kernel-only API instead of sequences of clone from fork/exec system calls. Two kernel threads have kthreadd as a parent. Apart from that, kernel … Read more

Is there a way to figure out what is using a Linux kernel module?

Actually, there seems to be a way to list processes that claim a module/driver – however, I haven’t seen it advertised (outside of Linux kernel documentation), so I’ll jot down my notes here: First of all, many thanks for @haggai_e’s answer; the pointer to the functions try_module_get and try_module_put as those responsible for managing the … Read more

Read/write files within a Linux kernel module

You should be aware that you should avoid file I/O from within Linux kernel when possible. The main idea is to go “one level deeper” and call VFS level functions instead of the syscall handler directly: Includes: #include <linux/fs.h> #include <asm/segment.h> #include <asm/uaccess.h> #include <linux/buffer_head.h> Opening a file (similar to open): struct file *file_open(const char … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)