Skip to content

Fix epoll_create1 flag register in my_syscall handling#3507

Merged
ptitSeb merged 1 commit intoptitSeb:mainfrom
devarajabc:haha
Feb 13, 2026
Merged

Fix epoll_create1 flag register in my_syscall handling#3507
ptitSeb merged 1 commit intoptitSeb:mainfrom
devarajabc:haha

Conversation

@devarajabc
Copy link
Contributor

In my_syscall, which handles the C ABI syscall() wrapper from libc, the registers are mapped according to the C calling convention: the syscall number is in RDI (S_EDI), and the first actual syscall argument is in RSI (S_ESI).

For epoll_create1 (syscall 291), the #ifndef NOALIGN fallback code was incorrectly passing S_EDI to of_convert(). This meant the syscall number itself (291) was being treated as the flags argument and passed through bitwise conversion, resulting in invalid flags being sent to the host's epoll_create1.

In `my_syscall`, which handles the C ABI `syscall()` wrapper from libc,
the registers are mapped according to the C calling convention: the
syscall number is in `RDI` (S_EDI), and the first actual syscall argument
is in `RSI` (S_ESI).

For `epoll_create1` (syscall 291), the `#ifndef NOALIGN` fallback code
was incorrectly passing `S_EDI` to `of_convert()`. This meant the
syscall number itself (291) was being treated as the `flags` argument
and passed through bitwise conversion, resulting in invalid flags being
sent to the host's `epoll_create1`.
@ptitSeb ptitSeb merged commit 98e5753 into ptitSeb:main Feb 13, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants