Skip to content

mm: enforce RLIMIT_DATA considering total data segment size (heap + data + bss) - #14082

Open
Ar1es-XD wants to merge 1 commit into
google:masterfrom
Ar1es-XD:fix-rlimit-data
Open

mm: enforce RLIMIT_DATA considering total data segment size (heap + data + bss)#14082
Ar1es-XD wants to merge 1 commit into
google:masterfrom
Ar1es-XD:fix-rlimit-data

Conversation

@Ar1es-XD

Copy link
Copy Markdown

Currently, MemoryManager.Brk only enforces RLIMIT_DATA for the heap because it only checks uint64(addr - mm.brk.Start) against the limit, ignoring the size of other private writable segments (like .data and .bss) which are mapped by the loader and tracked by mm.dataAS.

Fix this by checking the total size of private writable data segments (heap + data + bss + private writable mappings) against RLIMIT_DATA.

Fixes #156.
Assisted-by: Gemini CLI

@google-cla

google-cla Bot commented Aug 12, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

…ata + bss)

Currently, MemoryManager.Brk only enforces RLIMIT_DATA for the heap because
it only checks `uint64(addr - mm.brk.Start)` against the limit, ignoring
the size of other private writable segments (like .data and .bss) which are
mapped by the loader and tracked by `mm.dataAS`.

Fix this by checking the total size of private writable data segments
(heap + data + bss + private writable mappings) against RLIMIT_DATA.

Fixes google#156.
Assisted-by: Gemini CLI
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.

Expand RLIMIT_DATA to enforce .data + .bss in addition to heap

2 participants