Skip to content

sentry/iouring: return 0 instead of -1 for toSubmit=0#13522

Open
TristanInSec wants to merge 1 commit into
google:masterfrom
TristanInSec:fix-iouring-enter-tosubmit-zero
Open

sentry/iouring: return 0 instead of -1 for toSubmit=0#13522
TristanInSec wants to merge 1 commit into
google:masterfrom
TristanInSec:fix-iouring-enter-tosubmit-zero

Conversation

@TristanInSec

Copy link
Copy Markdown

io_uring_enter with toSubmit=0 returns uintptr(-1) with a nil error. The syscall dispatch writes -1 directly to RAX on the nil-error path, which userspace libc interprets as EPERM.

This is a valid and common call pattern: io_uring_wait_cqe() calls io_uring_enter(fd, 0, 1, IORING_ENTER_GETEVENTS) to wait for completions without submitting new work. Linux returns 0 for this case.

Returns 0 to indicate success when no submissions were requested.

io_uring_enter with toSubmit=0 returns uintptr(-1) with a nil
error. The syscall dispatch writes -1 directly to RAX on the
nil-error path, which userspace libc interprets as EPERM.

This is a valid and common call pattern: io_uring_wait_cqe()
calls io_uring_enter(fd, 0, 1, IORING_ENTER_GETEVENTS) to wait
for completions without submitting new work. Linux returns 0 for
this case.

Return 0 to indicate success when no submissions were requested.
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.

1 participant