PMKID Caching

PMKID stands for Pairwise Master Key Identifier. It is a unique identifier that is generated during PMK security association for a specific AP-Client. The PMKID computation is basically a truncate-128 operation on HMAC-SHA-1/HMAC-SHA-256/HMAC-SHA-384 hashing. The different ways of obtaining PMKID depends on the cipher suite selected for RSN. Refer section “12.7.1.3 Pairwise key hierarchy” in […]

sysfs APIs and sample sysfs implementation in the Linux Kernel

The below table provides a sub-list of sysfs APIs that can be used to provide data to user space from a kernel module. For a more comprehensive list – refer sysfs.h file in the specific Linux Kernel version that you are working with. Kernel API Description struct kobject *kobject_create_and_add(const char *name, struct kobject *parent) This […]

Tasklets in the Linux kernel

Tasklets are a means of achieving bottom-half processing in the Linux Kernel. What is bottom-half and the need for bottom half is explained in the article below. https://www.hitchhikersguidetolearning.com/2021/05/09/bottom-half-processing-in-the-linux-kernel/ Tasklets are the preferred mechanism to defer execution in Linux. Tasklets are implemented on top of softirqs – HI_SOFTIRQ and TASKLET_SOFTIRQ. The high priority tasklets (placed in […]

Bottom Half Processing in the Linux Kernel

What is “Bottom Half” ? This question can arise for any one who is new to the way Linux addresses a specific interrupt. In response to an interrupt, an interrupt handler might have to complete a number of tasks which might consume a significant amount of time but the interrupt line cannot be held high […]

Interrupt Service Routine (ISR)

The Interrupt service routine handles an interrupt in the Linux Kernel. The interrupt service routine for the Interrupt is registered using the “request_irq” API. The IRQ can be released using the “free_irq” API. The “handler” function pointer parameter in the request_irq API is the handler of the interrupt, The “irq” parameter is the interrupt request […]

Looking at /proc/interrupts

The “/proc” file-system provides details of the interrupts generated in the system. The output of “/proc/interrupts” is provided below.  The output of “/proc/interrupts” shows all the different interrupts that have handlers (Interrupt Service Routines – ISRs) registered for them. The first column indicates the IRQ number. Subsequent columns indicate how many interrupts have been generated […]

Interrupts in the Linux Kernel

An interrupt is a signal that tells the CPU that a significant event has occurred and needs the attention of the CPU. There are two types of interrupts that are provided in the Linux Operating system.  Hardware Interrupts – If the Interrupt is coming from an external hardware device connected to the CPU, the interrupt […]

Sys File System (sysfs) in the Linux Kernel

The sysfs is a RAM based virtual file system and provides details on various kernel objects. It provides a means to export kernel data structures, attributes and their linkages between the kernel objects and the user space. if “CONFIG_SYSFS” is enabled during build, “sysfs” is in-built into the linux image. The  file system can also […]

Example Linux Memory Allocation Code

The below code provides an example allocation of “kmalloc“, “vmalloc“, “kcalloc” and “kzalloc” APIs in the Linux kernel code. for the different APIs and information about the APIs, refer the article – Allocating Memory in the Linux Kernel Module  The “kmalloc” API provides a contiguous block of memory in both virtual and physical address space […]