Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
31 views

I'm using prctl(PR_SET_SYSCALL_USER_DISPATCH, ...) to enable Syscall User Dispatch with a SIGSYS handler that gets called when the application issues any syscall. The prctl() call also marks the code ...
patraulea's user avatar
  • 986
0 votes
2 answers
79 views

I am trying to build a mapping between the dynamic symbols in ELF files (from glibc) and the actual kernel syscalls they invoke. My environment is x86_64 Ubuntu 22.04. What I've Tried Parsing man 2 ...
신경철's user avatar
0 votes
1 answer
47 views

I'm struggling to reconcile the difference between the symbols listed in my ELF file's dynamic symbol table (.dynsym) and the system calls observed via strace. When I perform static analysis using ...
신경철's user avatar
3 votes
1 answer
116 views

I'm writing hello-world program for Minix 3.3.0 i386 in assembly. The exit(2) call works (and the exit code is propagated), but the write(2) call doesn't work. What am I doing wrong, and how do I fix ...
pts's user avatar
  • 88.7k
0 votes
0 answers
41 views

I am trying to use NtCreateNamedPipe to create a pipe in the current process but i keep on getting 0xc000000d status code, i tried multiple combinations of the arguments and change the pipe name many ...
Sec Team's user avatar
0 votes
1 answer
137 views

When a system call is invoked by a user program, a software interrupt (trap) is raised, control first passes to the fixed location of the interrupt vector (IR) which contains the ISR associated with ...
Fabio's user avatar
  • 33
1 vote
1 answer
88 views

I've been digging into "true" randomness idea, and I've noticed that modern CPUs support instructions for generating randomness. X64 has RDRAND instruction, while ARM has RNDR (I'm not ...
freakish's user avatar
  • 57k
0 votes
0 answers
54 views

I am trying to modify the ecall behavior in QEMU usermode simulation, so that i can intercept system calls. The way i intend to do it is by reading states from the CPURISCVState with tcg_gen_ld_tl -- ...
Overstacked's user avatar
5 votes
1 answer
146 views

On x86-64, the syscall instruction causes a privilege-level change from user mode to kernel mode. According to the Intel manual (Vol. 2A, SYSCALL—Fast System Call), during execution: CS is loaded ...
klezki's user avatar
  • 197
0 votes
0 answers
107 views

I've been given an assignment to store and write out a user-inputted string stored in buffer. My professor said that the number of bytes read is stored in rax after the user inputs the string into ...
Anthony's user avatar
1 vote
1 answer
89 views

So I am trying to understand if I am missing anything about calling futex_wait inside a signal handler for a SIGSEGV access violation. Ostensibly, it is not on the list of async-signal-safe calls, ...
Spiff's user avatar
  • 35
0 votes
0 answers
94 views

I'm trying to write NUMA-aware codes, and i encountered some unexpected behavior. I decide to use move_pages() to test if i create the correct NUMA placement but the result is very confusing. for (...
Lynn's user avatar
  • 11
1 vote
1 answer
65 views

In BSD, the pledge() syscall can be used to limit the process' access to potentially dangerous resources. Do these limitations apply to child processes that are forked from the parent, or are the ...
ijustlovemath's user avatar
1 vote
0 answers
123 views

As explained here it's clear to me that user-space calling conventions don't apply when dealing with kernel-space system call execution, so basically no register is clobbered after an ecall ...
SilenceDesigner's user avatar
0 votes
2 answers
74 views

man 2 brk says: int brk(void *addr); brk() sets the end of the data segment to the value specified by addr ... On success, brk() returns zero. On error, -1 is returned, and errno is set to ENOMEM. ...
Филя Усков's user avatar
1 vote
0 answers
65 views

I have checked the man7.org to find the answer, and I found that the Q_SETQUOTA subop of quotactl seems to support only user and group quota? Q_SETQUOTA Set quota information for user or ...
Yipeng's user avatar
  • 11
3 votes
0 answers
131 views

i am working in go. using syscall.SyscallN(), i returned a handle for a volume using the CreateFileW function from the windows api. when i print the error value returned by the syscall, i receive &...
baydırman's user avatar
0 votes
1 answer
119 views

So I am trying to build text editor in assembly and I came to problem of moving cursor on the screen while program is in input or reading mode I modified termios flags also little bit (turned off ECHO ...
skami0_0's user avatar
0 votes
1 answer
232 views

I am having a nixos system with BPF_SYSCALL disabled with below configurations: [root@nixos:/sys/fs/cgroup]# zgrep BPF /proc/config.gz CONFIG_BPF=y CONFIG_HAVE_EBPF_JIT=y ...
Uma Mahesh's user avatar
6 votes
1 answer
182 views

I'm working on an operating system programming assignment to understand pipes. M3.md The task involves using regular expressions to extract information from strace output and statistic system call ...
Julie Johnson's user avatar
1 vote
1 answer
137 views

RISC-V user-space function calls calling conventions are clear to me. It's also clear that a0-a5 are used to pass arguments to kernel and a7 to store system call number before an ecall. What I can't ...
SilenceDesigner's user avatar
2 votes
0 answers
56 views

I am trying to build some kind of simple text editor and I am trying to get input from user but it is not unlimited, user can only input 10 bytes of memory section .bss input resb 10 info ...
skami0_0's user avatar
1 vote
1 answer
85 views

I am trying to build a small text editor (first project in assembly) and I happen to need to find out the length of a string to give person error. This input will be used to open or create files in ...
skami0_0's user avatar
3 votes
1 answer
259 views

This might be a weird question, and it may very well be impossible, but is there a way to intercept all syscalls of a specific program? I have full control over the file, which mean I can scan and ...
anom907 zat's user avatar
1 vote
0 answers
69 views

Motivation I'm picturing a hypothetical update process for critical services, that might work like this (using C and POSIX names): Download the new update binary, to a separate place than current ...
ijustlovemath's user avatar
2 votes
0 answers
234 views

For educational purposes, I have to inject fault into a linux kernel. The current setup is: A system call, which injects the fault. In my case, I'm jumping to some random address that is probably ...
III_phr's user avatar
  • 96
0 votes
2 answers
136 views

I can wait for one of several network connections using select or epoll. I can wait for a signal using sigwaitinfo, or add a handler to run on receipt of the signal. How do I wait for either a network ...
Zachary Vance's user avatar
4 votes
1 answer
109 views

I have a program that reads from a file using O_DIRECT. The file is being continuously written to by another process. The read loop works fine until it reaches the point where the write is happening. ...
rishi jain's user avatar
0 votes
0 answers
50 views

As I know when you write code that is opening a stream to a file there is a call to your OS which returns the stream of that file. However I don't quite understand if I write something in several ...
Imersin's user avatar
1 vote
3 answers
154 views

I am trying to simulate a memory leak problem with the following code and then investigate the system calls resulting in memory leak. include <iostream> #include <thread> #include <...
Soumajit's user avatar
  • 376
0 votes
0 answers
119 views

I just don't understand a bit how the disassembled code outputs text without using syscall. Cpp reference looked like this: //Your First C++ program #include <iostream> using ...
user26492712's user avatar
0 votes
1 answer
96 views

Is madvise(*, *, MADV_DONTNEED) supposed to be purely advisory? I tried scanning /proc/self/maps and calling madvise(addr, size, MADV_DONTNEED) on the entries: #include <stdio.h> #include <...
MWB's user avatar
  • 12.7k
1 vote
1 answer
77 views

I want to create a new FILE* associated with stdout, using setvbuf() to change its buffer behaviour to _IONBF, but I don't want to change the behaviour of stdout, since the other part of the program ...
benrush's user avatar
  • 373
0 votes
2 answers
99 views

I've written a simple C program. It takes four command line parameters: file name, start position, length and byte value; opens the specified file for writing and, starting at the specified position, ...
Fyodor's user avatar
  • 185
0 votes
0 answers
97 views

What does happen if two threads call fsync on the same entity simultaneously? For example, they want to synchronize the same directory at the same time, when they create new files in it. I have ...
Funny's user avatar
  • 203
0 votes
0 answers
37 views

I want to benchmark some performance aspects of a Linux device driver (a loadable module). Specifically, how fast certain code paths are when they are invoked from userspace via system calls. In ...
Grigory Rechistov's user avatar
0 votes
1 answer
62 views

I'm fiddling with a BPF program that needs to attach to the two "getname" functions that are being called from the renameat2 syscall, defined in linux/fs/namei.c as: SYSCALL_DEFINE5(...
Dennis Orlando's user avatar
0 votes
2 answers
152 views

Hello I am trying to terminate the current thread using NtTerminateThread. I know that the function for the syscall takes 2 arguments which are the thread handle and the exit status but whenever I try ...
user24684540's user avatar
0 votes
2 answers
379 views

I'm experimenting with the Linux clone3() syscall (introduced in Linux 5.3) to create threads without using the standard library. While there are many examples of using the older clone() syscall, I ...
Mahdi Sharifi's user avatar
1 vote
0 answers
77 views

Trying to implemented syscall in kernel space and wrapper in glibc so I can call from userspace. When I call the function call in user program it says "Function not implemented". I have ...
prashanthlinganna's user avatar
1 vote
0 answers
104 views

I have a go application that calling the Windows Management Infrastructure (MI). After some amount of time, I notice that the amount of handle is quite high. I inspect the process with the handles ...
jkroepke's user avatar
  • 140
1 vote
0 answers
29 views

I am working on a simple assembly program that uses a loop to print a message a specific number of times. However, the loop is not terminating as expected and runs indefinitely. I am new to assembly ...
Rotter's user avatar
  • 11
2 votes
1 answer
84 views

I develop go pure go client for Windows Management Infrastructure (MI). It's the successor of WMI. While initialization works as indented package main import ( "unsafe" "...
jkroepke's user avatar
  • 140
1 vote
1 answer
447 views

I am trying to steal the statx syscall on Linux 6.8 and to modify the returning arguments. However, when attemp to load the module, I got a BUG about NULL pointer deference at line r = ...
flav's user avatar
  • 215
4 votes
2 answers
141 views

In man 7 signal, it describes certain constraints regarding when the SA_RESTART flag takes effect. read(2), readv(2), write(2), writev(2), and ioctl(2) calls on "slow" devices. A "...
Rock's user avatar
  • 178
1 vote
0 answers
125 views

I want to develop a trivial toolkit using direct syscalls for some of the native windows API procedures, for example I want to use NtOpenProcess to open a process and display some info related to the ...
katysha's user avatar
  • 139
0 votes
0 answers
80 views

I need to add two memory fences into my codes, in order to prevent my codes from being reordered by either the compiler or CPU. Like this: rec.time_stamp0 = std::system_clock::now(); std::...
Leon's user avatar
  • 2,165
-1 votes
1 answer
87 views

I faced this problem in the below C++ program #include <bits/stdc++.h> #include <unistd.h> #include <sys/wait.h> using namespace std; std::vector<std::string> args; void ...
PaRat07's user avatar
0 votes
1 answer
313 views

Hello, everyone. It is necessary that the calling process and the child process are in the same memory space. Therefore, I use the CLONE_VM flag. But the child process does not start. It looks like ...
0m3's user avatar
  • 9
0 votes
0 answers
70 views

I'm writing a small program which uses fork() to create 4 child threads. I am new to working with fork() and want to make certain I am using the most thread-safe approach. The issue I am having does ...
mreff555's user avatar
  • 1,152

1
2 3 4 5
77