Category "linux-kernel"

Why is Intel Pin not able to instrument open syscall?

I am trying to build a pintool that should be able to instrument an open() syscall that targets a specific file/directory and replace the file path argument wit

Why does strace ignore some syscalls (randomly) depending on environment/kernel?

If I compile the following program: $ cat main.cpp && g++ main.cpp #include <time.h> int main() { struct timespec ts; return clock_gettime

Which all multicast groups are available under custom netlink protocol

I am trying to send a notification message from a kernel module to user space application using netlink sockets interface and custom netlink protocol. My unders

how to bind thermal temperature sensor with emc2103 fan

how to bind an external temperature sensor with fan emc2103 in Linux. As emc2103 has its own temperature sensor which its use to control fan speed. but I want t

Where does mount API implemented in Linux source code?

I am newbie for Linux kernel, I cloned the Linux source from its repo on GitHub. I cannot find the file sys/mount.h nor the mount function. Do you know where is

Understanding the `scheduler_tick()` function of Linux Kernel

To my knowledge, I understood that the scheduler_tick() function periodically gets called by the timer interrupt with the frequency of HZ. I'm new to kernel dev

How kernel know which driver to be called when we are calling any socket from user-space?

I am using IWD as a wireless daemon in userspace. Driver and firmware are loaded. When the socket is called by IWD using nl80211, it passes to nl80211 and than

Error "assignment from incompatible pointer type" when creating a Netfilter kernel module

I'm implementing a "mini firewall" and use the filter function with the signature shown below: unsigned int minifw_inbound_filter(unsigned int hooknum, struct s

Why can low priority processes affect the latency of an high priority process?

I have tested the rt process's latency by cyclictest. And found that when I launch a few lower priority rt processes(priority is 40) the high priority rt proces

How to build multiple linux kernel module with multiple source files in a single Makefile?

I am trying to build a set of Linux kernel modules with multiple source files: obj-m += mst_pciconf.o mst_pci.o mst-objs += nnt_device.o nnt_dma.o nnt_pci_conf_

A pthread with SCHED_RR and higher real time priority failed to preempt a kthread in kernel module with lower priority

Preface: I have two threads: one kernel thread and one userspace pthread. I assume pthread set to SCHED_RR with higher rt priority should preempt a kthread with

Can compilers break control dependencies used for LoadStore memory ordering or similar, in any real use-cases?

I'm reading the mail list about LKMM: Add volatile_if(). The control dependency is somewhat subtle since it is easily forgotten by us developers. So I wonder i

ftrace cannot trace some kernel functions

I'm using ftrace to trace ip_local_out() in kernel 5.4.20. I'm sure ip_local_out() is available to trace: /sys/kernel/debug/tracing # cat available_filter_funct

Error building program using gcc plugin from linux kernel source tree

I am trying to use a grsecurity gcc plugin that I found on their unofficial linux kernel source tree (the respectre_plugin/ one). My GCC version is 4.7, I modif

What is the benefit of calling ioread functions when using memory mapped IO

To use memory mapped I/O, we need to first call request_mem_region. struct resource *request_mem_region( unsigned long start, u

Using populate_sdk to include kernel headers

How do I include the linux kernel headers as part of the SDK package in Yocto? I'm using Yocto 1.8 (fido) in an embedded project and want to do out-of-tree ker

What is linux vhost and how it helps virtio offloading?

I finished reading https://www.redhat.com/en/blog/introduction-virtio-networking-and-vhost-net and couldn't understand exactly. I understand how virtio works. H

Linux kernel: is a re-assigned page frame cleared?

When a process ends, the Linux kernel can re-assign the user-space page frames (the pages in physical memory) to the user-space pages (in virtual memory) of ano

How to debug in kernel mode using printk

I am trying to add some stuff to Linux task_struct. In this area I copy a string from the user and try to store it in my struct. I try to debug my code by add

IP tuntap command can't open tun

I want to create a TUN interfae I type command in adb like below mkdir -p /dev/net busybox mknod /dev/net/tun1 c 10 200 chmod 666 /dev/net/tun1 ip tuntap add d