Skip to content

sentry/aio: validate nrEvents in io_setup#13518

Open
TristanInSec wants to merge 1 commit into
google:masterfrom
TristanInSec:fix-io-setup-nrevents-validation
Open

sentry/aio: validate nrEvents in io_setup#13518
TristanInSec wants to merge 1 commit into
google:masterfrom
TristanInSec:fix-io-setup-nrevents-validation

Conversation

@TristanInSec

@TristanInSec TristanInSec commented Jun 19, 2026

Copy link
Copy Markdown

io_setup reads nrEvents as int32 and casts to uint32 with no validation. Negative values wrap to large unsigned values (e.g. -1 becomes 4294967295), and zero is accepted despite being invalid. Each io_submit against such a context spawns a goroutine, so an uncapped maxOutstanding allows unbounded sentry memory growth.

Linux rejects nr_events == 0 with EINVAL and caps against aio_max_nr (default 65536) in do_io_setup().

This adds bounds checking before the uint32 cast: reject values <= 0 and values exceeding 65536.

io_setup reads nrEvents as int32 and casts to uint32 with no
validation. Negative values wrap to large unsigned values (e.g.
-1 becomes 4294967295), and zero is accepted despite being
invalid. Each io_submit against such a context spawns a
goroutine, allowing unbounded sentry memory growth.

Linux rejects nr_events == 0 with EINVAL and caps against
aio_max_nr (default 65536) in do_io_setup().

Add bounds checking before the uint32 cast: reject values <= 0
and values exceeding 65536.
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