Questions tagged [userspace]
109 questions
1
vote
1 answer
In Linux kernel mode, how to execute a user space command
I hook execve in kernel mode(change system_call_table entry __NR_execve to my function). I want to check the ELF's assembly code. If it harmful, I'll return directly without executing it.
I am writing a linux module. In Linux kernel mode, I want to…

siyuan
- 113
- 7
1
vote
2 answers
Best way to run a loop for certain amount of time
I have to run a loop for certain amount of time. I know the following way to do that.
get start time;
while(1)
{
getcurrenttime;
if(start time + time to run >= current time)
break;
else
do what ever you want.
}
Is it ok ? or…

Chinna
- 3,930
- 4
- 25
- 55
0
votes
0 answers
I2C device drivers in userspace : mutex on ioctl and smbus address
While reading the linux kernel documentation on I2C device drivers from user space, I noticed that ioctl() is used to "put the address on the bus".
So a typical workflow as described is:
Open /dev/i2c-N and call ioctl() on it. By doing so you…

Sam Hammamy
- 10,819
- 10
- 56
- 94
0
votes
1 answer
Userspace use Generic Netlink Library pass NLA_NESTED data to kernel error
How to fill NLA_NESTED data in the Userspace Generic Netlink Library data and send to the kernel? please help me
This is my code :
void *msg_h = genlmsg_put(msg, NL_AUTO_PORT, NL_AUTO_SEQ, m_id, 0, 0,
…

zyy
- 1
- 1
0
votes
0 answers
how pass data from kernel space to user space - copy_to_user()
im trying to write module linux that monitor all system calls, and send system call log (data struct) to my program in user space. information such as who PID call syscall, what arguments passed and etc.
i trying to write this feature by IOCTL,…

LINux
- 11
- 1
0
votes
1 answer
How to send data from kernel to userspace through signals (send_sig_info)?
Does anyone know how to send data from a kernel module to a userspace app, via signals? Actually, I have a kernel module that uses the function send_sig_info() to notify a userspace app (registered through ioctl) about some events happening in the…

Adel Belkhiri
- 33
- 4
0
votes
0 answers
UDP packet re-ordering in linux
I understand that UDP does not guarantee order of packets, but that is at Transport layer.
Does the Linux kernel guarantee ordered UDP packets to user space programs ?
I read that services like DNS and DHCP use UDP and they have daemons running in…

golimoli
- 143
- 9
0
votes
2 answers
enable Dpdk application talk to Linux process
I have DPDK-20.11.3 installed.
Given that a Dpdk application is a process from the Linux point of view, I would assume that there should be ways (possibly with constraints) of communication between the Dpdk application and Linux native application…

Mark
- 6,052
- 8
- 61
- 129
0
votes
1 answer
What prevents from copy_to_user to succeed on kmap'ed pages from a non-current task?
This is a new and modified question for: What is needed to be able to access a user pointer from kernel-space as I lost access to my account.
I want to write to start_arg. start_arg is a pointer to a user-space process argv[0], i.e int main(int…
0
votes
1 answer
QEMU Reboots on sysret
I'm writing a small Kernel to learn more about Operating ystems.
I recently decided to start implementing User Mode, just for fun.
To achieve this, I followed this guide:…

user15389823
- 41
- 3
0
votes
1 answer
Do any operating systems utilize user threads only?
We're reading a basic/simple guide to Operating Systems in my CS class. The text gives multiple examples of OSs that use 1:1 threading, and some that formerly did hybrid/ M:N. But there are no examples of user threads/N:1.
This isn't a homework…

VintageMacFan
- 1
- 1
0
votes
0 answers
Read From A Device in Kernel Module
Is it possible to read from a device in a kernel module? For example if I wanted to read from /dev/sda how would I go about doing that (I picked /dev/sda just as an example, in my exact scenario I need to read from a character device)? I know user…

Harry Muscle
- 2,247
- 4
- 38
- 62
0
votes
0 answers
How can I print call trace in a C program
Now I'm writting a C program on linux system.I want to print the call trace information on cpu, just like what dump_stack() does in kernel space or what command echo t > /proc/sysrq-trigger shows.
I've found some ways but they all need to be used in…
0
votes
0 answers
Copy from user space to Kernel modul
I would like to copy the variable "register_val" (unsigned int) to an address "addr_user" (unsigned int *) from the user space in the kernel module.
Why does the following code to copy not work?
*addr_user = register_val;
0
votes
0 answers
return of page_address in module and copy it to userspace buffer. is there a way
is there a way to copy/map the return of page_address to userspace buffer passed file's read function
what I read is
page_address()
returns virtial address of the page. and takes pointer to a page which is of kernel's data type
for example I have…

user786
- 3,902
- 4
- 40
- 72