How does Linux buddy allocator determine which size order list to insert into...
The Binary Buddy Allocator used in Linux uses bitmaps where each bit corresponds to a state of a pair of buddy-blocks (taken from this article). And the void free_page(void *addr) call doesn't take a...
View ArticleHow to enable signed-integer-overflow UBSan in linux kernel
As I was configuring the kernel 5.4.0 withCONFIG_UBSAN=yUBSAN_SANITIZE_ALL=yand -fsanitize=signed-integer-overflow also appeared in gcc command during compilation.However, in the final vmlinux,...
View ArticleHow can I allocate dma buffers in a very specific range in linux kernel?
I have a microprocessor which can access only 0xFFFFFF bytes in the DDR through its data cache. I can give it the offset where it can start to read these 0xFFFFFF the DDRI want to allocate dma buffers...
View ArticleDoes Linux kernel list implementation cause UB?
Prerequisites:As per C standard, pointer arithmetics that would yield an invalid pointer, cause undefined behavior.Linux source code seems to conform with C standard in a desire to be compatible with...
View ArticleLinux logical address to physical address
I want to convert the logical address to physical address.pgd_offsetpud_offsetpmd_offset seems good but pte_none(pte_offset_kernel) return -1...pte_tmp = pte_offset_kernel(pmd_tmp, vaddr); if...
View Articlehow to disable/lift linux kernel lockdown on ubuntu 20.04?
currently l start learning bpftrace,but cause of the Lockdown, it could not work.after some search i found unlockdown, but it says(Updated 21.03.2020.) At this point, all proposed bypass methods have...
View ArticleHow to use a Linux "platform_driver"?
There is an embedded system, and it provides functions in a struct of platform_driver:static struct platform_driver infinity_wdt_driver = { .probe = infinity_wdt_probe, .remove = infinity_wdt_remove,...
View Articlegpg: no valid OpenPGP data found; using add repository
so when i input sudo apt-add-repository ppa:elementary-os/stable it returns More info: https://launchpad.net/~elementary-os/+archive/ubuntu/stablePress [ENTER] to continue or ctrl-c to cancel adding...
View ArticleCan't enable FTRACE in yocto, no /sys/kernel/debug/tracing created
I'm using yocto to build the kernel image and can't enable the ftrace on the ARM board,Tried these:How to Enable or configure ftrace...
View ArticleReading block from MTD flash with ioremap
I would like to know the expected result of reading block data from MTD flash, as per the code below:#define PHY_ADDR 0x80000000 // certain physical memory locationvoid *dst;dst =...
View ArticleCannot create symlink on Linux
I'm struggling with Linux compiling problem. There are many versions of the Linux kernel source, but it usually ends with an extraction fail or fatal error.In this case, I used Linux-5.9.8.tar.xz and...
View Articlemaximum number of uprobe using bcc/bpf
I use bcc to trace userspace program with uprobe.However, I cannot attach more than 500 uprobe.I am wondering is there a limit of how many uprobe can be attached at the same time?Or is there a kernel...
View Articlehow does the bootloader pass the kernel command line to the kernel?
We can see the kernel command line like this :ckim@chan-ubuntu:~/$ cat /proc/cmdline BOOT_IMAGE=/boot/vmlinuz-4.15.0-122-generic root=UUID=99c66a0a-39c1-451c-9f72-ad1576aafb41 ro quiet splashThis...
View ArticleGCM(AES) with Linux Crypto API
I am learning how to use Linux Crypto API.I used with success with .salg_type = "skcipher", .salg_name = "cbc(aes)" However with "aead"/"gcm(aes)" sendmsg sets error Invalid Parameter (22). What is...
View ArticleC- displaying CPU info using kernel module
I've recently learned about kernel modules and I was thinking on how to create one that does what cat /proc/cpuinfo does.Is it possible to do this without opening/reading the file directly (fread)?...
View ArticleLinux Kernel Module functions documentation [closed]
I am trying to understand a network driver in Linux kernel version 5.8. I am encountering a lot of kernel APIs or functions whose documentation is needed to understand their functionality. e.g....
View ArticleRaspberry Pi 4 U-Boot on booting hanging in Starting Kernel
I am working on a project where I want to create my own embedded linux with U-Boot. Therefore I am working with buildroot, which i recently start learning. After successfully creating my own...
View ArticleDoes the close() system call close all references to the file?
Let's say we have a pipe, my_pipe, which occupies file descriptors at entries 3 and 4 of the process's FDT (initial FDT scheme)First, we close the stdout standard output stream using close(1) (updated...
View ArticleNetfilter hook on the bridge not getting called
I am adding a hook function on a bridge.The question is: when in nf_hook_ops struct I use pf value like 7 (defined in PF_BRIDGE) then it DOESN'T work:static struct nf_hook_ops nfho;nfho.hook =...
View ArticleKubernetes dynamic configurationn of CPU resource limit
Kubernetes CPU manager provides a way to configure CPU resource limit statically. However, in some cases it could lead to a waste of cluster resources, for example an application could require...
View Article