Skip to content

Guard txn_box stack allocations#13128

Closed
bneradt wants to merge 1 commit into
apache:masterfrom
bneradt:txn-box-stack-alloca-guards
Closed

Guard txn_box stack allocations#13128
bneradt wants to merge 1 commit into
apache:masterfrom
bneradt:txn-box-stack-alloca-guards

Conversation

@bneradt
Copy link
Copy Markdown
Contributor

@bneradt bneradt commented Apr 29, 2026

Large tuple features and Host field rewrites can flow through txn_box from
request-controlled input. Several paths used alloca with sizes derived from
those values, which could consume a large fraction of the ATS thread stack or
overflow it outright.

This bounds the temporary filter tuple array by a byte budget and aligns Host
field rewrite buffers with the core host-name limit. Oversized filter input now
returns an error, while oversized Host rewrites leave the existing Host field
unchanged instead of allocating a large stack buffer.

Large tuple features and Host field rewrites can flow through txn_box from
request-controlled input. Several paths used alloca with sizes derived from
those values, which could consume a large fraction of the ATS thread stack or
overflow it outright.

This bounds the temporary filter tuple array by a byte budget and aligns Host
field rewrite buffers with the core host-name limit. Oversized filter input now
returns an error, while oversized Host rewrites leave the existing Host field
unchanged instead of allocating a large stack buffer.
@bneradt bneradt added this to the 11.0.0 milestone Apr 29, 2026
@bneradt bneradt self-assigned this Apr 29, 2026
@bneradt bneradt closed this Apr 29, 2026
@bneradt bneradt deleted the txn-box-stack-alloca-guards branch April 29, 2026 20:25
@zwoop zwoop modified the milestones: 11.0.0, 10.2.0 May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants