Questions tagged [linux-kernel]

1

votes
1

answer
1.1k

Views

Does NodeJS respect Docker virtualization and resource limits?

It is known that some applications aren't aware of Linux kernel isolation and virtualization features such as cgroups. This includes system utils like top, free and ps, but also platforms like Java. I've recently read an article which suggests that when running JVMs in Kubernetes, you should enforce...
Kir
3

votes
0

answer
28

Views

How to wake up a task sleeping with schedule_hrtimeout before the timeout occurs in linux kernel?

In the Linux Kernel I am putting a task asleep with set_current_state(TASK_INTERRUPTIBLE); schedule_hrtimeout(&next_release_time, HRTIMER_MODE_ABS); That works so far. The documentation says: /* %TASK_INTERRUPTIBLE - the routine may return early if a signal is * delivered to the current task or the...
pixy
1

votes
1

answer
30

Views

error: positional initialization of field in ‘struct’ declared with ‘designated_init’ attribute [-Werror=designated-init]

I am trying to adjust an old kernel module (written for 2.6.x kernel) for kernel 4.6.x. The code has a struct declaration as seen below: struct tcpsp_sysctl_table { struct ctl_table_header *sysctl_header; struct ctl_table tcpsp_vars[NET_TCPSP_LAST]; struct ctl_table tcpsp_dir[2]; struct ctl_table ro...
kr1stj0n
1

votes
2

answer
42

Views

Multiple values in a single macro definition with __SYSCALL_DEFINEx

I am trying to understand a chunk of code from /include/linux/syscall.h, where a macro definition seems to have multiple values, with semicolons separating each one of them: 235 #define __SYSCALL_DEFINEx(x, name, ...) \ 236 __diag_push();...
xczzhh
1

votes
2

answer
76

Views

why is the open() syscall supported on some Linux systems and not others?

I am inlining syscalls. Yes, I understand this is problematic but I have a good reason. I've tracked down my bug considerably and I'm just asking why has __NR_open disappeared on this arm64 Arch Linux system? 5.0.1-1-ARCH #1 SMP Sun Mar 10 15:08:34 MDT 2019 aarch64 GNU/Linux Again, my code is inlini...
Olsonist
1

votes
2

answer
984

Views

How to pass parameters to Linux system call?

I'm a college student studying OS. I'm trying to add my own system call in Linux kernel, and something is going wrong. My environment is stated below: Linux Kernel v.4.19.1 64-bit Ubuntu LTS 18.04.1 with Intel Core i5-4210M CPU on Oracle VirtualBox 5.2.18 64-bit Windows 10 Home 1803 as a host machin...
P. Heekang
1

votes
1

answer
63

Views

'strsep' causing Linux kernel freeze

I have a program in userspace that writes to a sysfs file in my kernel module. I have isolated that with high probability the source of the crash is this specific function, as when I run the user code before reaching this point it doesn't crash, but when I add the write code it crashes with high pro...
Eloo
1

votes
1

answer
39

Views

-bash: /bin/ls: Argument list too long if there is a lot of PATH [closed]

I have set about two thousand paths in PATH variable (I know its excessive but I experiment something) and whenever I try to run any command I get the following error, in this case its ls. -bash: /bin/ls: Argument list too long I have checked several topics about the error message. However, I was wo...
verte
1

votes
1

answer
208

Views

Linux Kernel error: missing binary operator before token “(”

Some simple preprocessor code in Linux Kernel module gives error: missing binary operator before token '(' The code: #if defined(AAA) || defined(BBB) #if LINUX_VERSION_CODE
z0lupka
1

votes
0

answer
271

Views

resizing file size with ftruncate() after mmap()

The code snippet works fine on my machine(Linux/x86-64) int main() { char* addr; int rc; int fd; const size_t PAGE_SIZE = 4096; // assuming the page size is 4096 char buf[PAGE_SIZE]; memset(buf, 'x', sizeof(buf)); // error checking is ignored, for demonstration purpose fd = open('abc', O_RDWR | O_CR...
tristan
1

votes
2

answer
508

Views

How to build the Linux kernel for powerpc and boot it on qemu?

I had compile a linux kernel and generating root file system using buildroot for 64-bit powerpc. Target CPU POWER7. Output of buildroot: 1] rootfs.cpio 2] rootfs.ext2 3] rootfs.tar.gz 4] vmlinux Start qemu simulation with qemu-system-ppc64 -m 1024 -kernel output/images/vmlinux -initrd output/images/...
Shail Thacker
1

votes
1

answer
372

Views

Load linux kernel module at boot

I have written a kernel module for a study research project that is a driver for seven segment displays connected to a Raspberry Pi (I am pretty new to kernel development). I would like to permanently install the module and load it at boot time when it is compiled, so I added the install target to m...
Sandtler
0

votes
0

answer
14

Views

How to Debug 'ip link add vrf-blue type vrf table 10' RTNETLINK answers: Operation not supported

I am trying to enable vrf in Linux kernel 4.9.135 version and have enabled IP_MULTIPLE_TABLES, NET_L3_MASTER_DEV and NET_VRF in kernel and build the kernel. bash-4.3# zgrep 'CONFIG_NET_VRF' /proc/config.gz CONFIG_NET_VRF=m bash-4.3# zgrep 'IP_MULTIPLE_TABLES' /proc/config.gz CONFIG_IP_MULTIPLE_TABL...
Uma Shankar
1

votes
0

answer
35

Views

why does linux 0.11 use read lock when doing block reading?

I have read linux source code about block device part of version 0.11 and i found if two processes do reading block operation, one will lock the buffer(bh),another one has to wait this lock, my question is why reading will block each other by using such kind of locker? isn't it supposed to be write...
terry
1

votes
1

answer
113

Views

why can't kernel access user process address directly

This article https://lwn.net/Articles/75174/ says that if the kernel wants to access a physical page, it needs to map it to a linear address in the kernel space (to high memory region). Suppose the page is already mapped by an user process, can the kernel just use the user-process page table to acc...
user1734905
1

votes
1

answer
85

Views

replacing all files with sed -i Argument list too long [closed]

I want to replace all files with sed -i. I want to replace word oldstring with newstring root-: sed -i 's| oldstring | newstring |g' * Argument list too long I have many files in the same dir. I want to replace all files strings. How can I solve this problem?
Sultan Alotaibi
1

votes
1

answer
259

Views

Can non-blocking system calls be interrupted?

I am reading The Linux Programming Interface which describes (in section 21.5) how a blocking system call can be interrupted by a signal. This seems to imply that a non-blocking system call cannot be interrupted. Is this true?
dippynark
1

votes
0

answer
67

Views

Invoke execvp from linux driver

Currently, i want to call execvp from kernel side. My program is programmed to go to halt mode. So i have tried to setup below code: char *argv[] = { '/sbin/halt', '-f', NULL }; char * envp[] = { 'SHELL=/bin/sh', 'HOME=/', 'PATH=.:/sbin:/usr/sbin:/bin:/usr/bin', 'PWD=/', NULL }; rc = call_...
Tiktac
1

votes
0

answer
145

Views

How to set the cpumask of an unbound workqueue from within the kernel?

I've noticed it's possible to set the cpumask of all unbound workqueues using workqueue_set_unbound_cpumask(), however I don't see anything that will target a specific workqueue. The real thorn in my side is that struct workqueue_struct is defined within the source file, so I can't access any of it...
jjh
1

votes
0

answer
93

Views

Virtual Address split in el2linux

According to this slides, when Linux is running in EL1 the Virtual Address space is in two different page tables: User space in TTBR0_EL1 (from 0x0 to 0x7f ffffffff) Kernel space in TTBR1_EL1 (from 0xffffff80 00000000 to 0xffffffff ffffffff) [both Linux Kernel & VM kernel?] From what I understood,...
igng
1

votes
1

answer
43

Views

Where does kernel checks file's privilege before access?

I try to understand how kernel check privilege of files, and which kernel files are actually responsible for this task. I haven't found documentation of this issue, except for https://www.kernel.org/doc/Documentation/security/credentials.txt Trying to search for credentials keyword in kernel I find...
ransh
1

votes
0

answer
153

Views

Why does linux kernel enable interrupt in preempt_schedule_irq?

I'm reading linux source code to learn how scheduling works. I learn that in a preemptible kernel(CONFIG_PREEMPT is set), there is a chance for preemption after returning to kernel-space from interrupt handler by calling preempt_schedule_irq. However, I also find the following code snippet in preemp...
biggerfish
1

votes
0

answer
143

Views

Implementing RTOS on BeagleBone Blue

I have a few questions related to the BeagleBone Blue, Background: I want to implement my own flight control scheme on this platform and for the same I wish to write the whole controller from scratch. I however do not wish to write the HAL again myself as I am not at all equipped to do so. So my que...
BabaYaga
1

votes
0

answer
83

Views

Grab what is shown on the screen in linux

I understand that in Linux a windowing system (X11, Wayland etc.) is responsible for rendering applications on the screen. I experimented with X11 but never got past obtaining single windows. I also read about Wayland. My question is, if I want to write an application that grabs whatever is shown on...
Niko
1

votes
0

answer
273

Views

How to disable logging in dmesg (/proc/kmsg) for specific device/driver?

I am using a TechnoTrend TT-connect S2-3600 which is known for spamming dmesg (respectively /proc/kmsg) with the following errors: [ 8360.122449] pctv452e: I2C error -121; AA A1 CC 00 01 -> 55 a1 31 03 cc 00 00 [ 8360.135079] pctv452e: I2C error -121; AA B8 CC 00 01 -> 55 b8 31 03 cc 00 00 [ 8360....
schmodd
1

votes
0

answer
85

Views

kernel crash bug caused by ixgbevf kernel module of centos-3.10.0-229.20.1.el7?

I found a bug about ixgbevf kernel module on centos-3.10.0-229.20.1.el7. And I think this bug is fixed in 3.10.0-514.10.2.el7. So could someone tell me which patch fix this bug, or how to find this patch? BUG: [308026.586026] ixgbevf 0000:01:10.0: NIC Link is Down [308026.586037] ixgbevf 0000:01:10....
batmancn
1

votes
1

answer
49

Views

one physical page allocated when malloc() called

I was trying to find the virtual set size and resident set size of a c program. I wrote a kernel module to traverse the vm_areas and calculated vss and rss. I also wrote one c program to validate the changes in vss and rss. // sample test program #include #include #include #define N 10000000 int...
Debashish
1

votes
1

answer
457

Views

How should a uio_dmem_genirq driver be configured via the device tree

The uio_dmem_genirq driver is backwards compatible with the uio_pdrv_genirq driver but with the addition that it dynamically allocates continuous memory. How do the device tree entries have to be defined to load the dmem driver? The working configuration for the pdrv version consists of the followin...
Moritz
1

votes
1

answer
51

Views

Does every call to write sends switches to kernel mode?

I know that a call to the glibc 'write' function calls in it's turn to the sys_call write function which is a kernel function. because sys_call is a kernel function the CPU has to change the ring to zero store the processes registers and so on. But does it always switches to kernel mode? for example...
DsCpp
1

votes
1

answer
32

Views

How bad is modifying the timer interrupt?

Suppose we're talking about a cloud linux server. For a project I have. How bad would it be to modify the timer interrupt such that on each tick the processor will also check 1-4 cached dwords ? Will that run the system totally unstable? Much slower? Second, is the timer interrupt is anywhere near...
David Salame
1

votes
0

answer
327

Views

Why android introduce binder in linux kernel?

I'm trying to learn into android (linux) kernel, and I know that android needs very fast (zero-copy) IPC, but still, I don't get the reason why binder needs to be there. Can the same thing done with unix socket + mmap /dev/shm file ? Let's say using dbus, but to achieve zero-copy, create and open fi...
win-t
1

votes
0

answer
141

Views

am335x ti-linux 4.9.80 ubi NAND flash rootfs partition not recognized

I have a strange problem with ubi partition recognition by ti-linux kernel 4.9.80. On the kernel ti-4.9.24 everything works fine, kernel discovers partitions and create. On 4.9.80 I have a log as following [ 1.664947] omap_voltage_late_init: Voltage driver support not added [ 1.678146] omap-gp...
Voloviq
1

votes
1

answer
511

Views

What is kernel dynamic memory in linux systems and how to free it

This question is related to https://serverfault.com/questions/896282/cannot-explain-memory-occupancy-in-linux/896525#896525 and to How to correctly identify and correct a memory leak on a server? What is kernel dynamic memory? I have virtually no process running in my workstation now $ ps aux --sor...
mox
1

votes
0

answer
56

Views

ARM domains in the Linux kernel

I have been reading through some ARM code in order to try and understand what exactly the cpu_domain field inside the struct thread_info represents. In an attempt to understand how it is used, I looked through the places where the variable is referenced. I am trying to understand the following :- Wh...
learnlearnlearn
1

votes
1

answer
511

Views

How to trun on graphics acceleration (kernel-module-imx-gpu-viv) on i.Mx6Q (buildroot)?

I enter these command on i.Mx6Q (Buildroot) with qt5 # export QT_QPA_EGLFS_INTEGRATION=eglfs_viv # CinematicExperience-demo -platform eglfs The demo app run normally, but it shows: qt.qpa.egldeviceintegration: Failed to load EGL device integration 'eglfs_viv' I found this said this error means I don...
Julia Ding
1

votes
0

answer
202

Views

Getting the file path of a write system call

I want to write a Kernel Module or a kernel space hook to catch all write system calls and get the location of the file it is going to write to, so that I can redirect that write to make changes on a temporary location instead of that particular file.
Shashank Shekhar
1

votes
0

answer
216

Views

How can we define SPI devices on x86?

I want to read data from CAN bus and for that I am using MPC2515 (as a CAN Conroller) via SPI. Working on Up Board 2 based on Ubilinux (Linux kernel version is 4.9.45), its architecture x86 doesn't use device-tree entries like ARM for example. So how can I define SPI device settings?
MaryemAyadi
1

votes
0

answer
78

Views

Building 3rd party linux kernel modules: changes with kernels after 4.9?

I've been building my own kernels on Ubuntu for years, using make-kpkg from the kernel-package package. All I had to do after installing the linux-image and linux-headers packages was to correct the /lib/modules/4.x.y/{source,build} symlinks so they pointed to the /usr/src/linux-headers-4.x.y direct...
RJVB
1

votes
0

answer
505

Views

What is the effect of using ioremap on physical address already ioremapped by a driver?

I am trying to use the ARM watchdog thorough kernel space. I have a watchdog driver which is statically built and deployed in the kernel. The memory remapped by the driver is seen in /proc/iomem. cat /proc/iomem | grep wdt ff567000-ff567018 : /[email protected] The driver has remapped the address startin...
nishad kamdar
1

votes
1

answer
259

Views

Limit the number of file descriptors a process can open over its lifespan

I'm on a debian based system. One of the vulnerability I'm trying to solve is multiple zero byte file creation which tends to exhaust inodes available in the Filesystem. My system allows users to execute code in a sandboxed environment and all resource ulimits are set (memory, cpu, process, STDOUT,...
user2830601

View additional questions