Skip to content

nolibc: fix integer overflow in __uring_malloc - #1544

Merged
axboe merged 1 commit into
axboe:masterfrom
rootvector2:overflow_in__uring_malloc
Mar 1, 2026
Merged

axboe merged 1 commit into
axboe:masterfrom
rootvector2:overflow_in__uring_malloc

Conversation

@rootvector2

@rootvector2 rootvector2 commented Mar 1, 2026 •

Copy link
Copy Markdown
Contributor

The addition of sizeof(*heap) and len can overflow size_t when len is
close to SIZE_MAX. This results in an undersized mmap allocation while
heap->len records the small wrapped value, leading to a heap buffer
overflow on subsequent writes to the returned pointer.

Add an overflow check before passing the computed size to mmap.

Signed-off-by: Naveed <dxbnaveed.k@gmail.com>

@axboe

axboe commented Mar 1, 2026

Copy link
Copy Markdown
Owner

You're missing a Signed-off-by in your commit message.

The addition of sizeof(*heap) and len can overflow size_t when len is
close to SIZE_MAX. This results in an undersized mmap allocation while
heap->len records the small wrapped value, leading to a heap buffer
overflow on subsequent writes to the returned pointer.

Add an overflow check before passing the computed size to mmap.

Signed-off-by: rootvector2 <dxbnaveed.k@gmail.com>
@rootvector2
rootvector2 force-pushed the overflow_in__uring_malloc branch from 2026ecb to 8d8200d Compare March 1, 2026 13:58
@axboe

axboe commented Mar 1, 2026

Copy link
Copy Markdown
Owner

Pulling this as a cleanup, there's no real issue here in terms of the liburing use cases. Thanks!

@axboe
axboe merged commit 83c2308 into axboe:master Mar 1, 2026
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