Skip to content

Kqueue: Possible overflow when using netty_kqueue_bsdsocket_setAcceptFilter(...)#16451

Merged
normanmaurer merged 1 commit into
4.2from
overflow
Mar 13, 2026
Merged

Kqueue: Possible overflow when using netty_kqueue_bsdsocket_setAcceptFilter(...)#16451
normanmaurer merged 1 commit into
4.2from
overflow

Conversation

@normanmaurer

Copy link
Copy Markdown
Member

Motivation:

How we used strncat(...) was incorrect and could produce an overflow as we did not take the null termination into account. We should better use strlcat(...) which is safer to use and less error-prone.

Modifications:

  • Validate that we will not truncate and so might use the "incorrect value"
  • Use strlcat(...) and so correctly respect the null termination which could cause an overflow before

Result:

Fix possible overflow on systems that support SO_ACCEPTFILTER

…Filter(...)

Motivation:

How we used strncat(...) was incorrect and could produce an overflow as we did not take the null termination into account. We should better use strlcat(...) which is safer to use and less error-prone.

Modifications:

- Validate that we will not truncate and so might use the "incorrect value"
- Use strlcat(...) and so correctly respect the null termination which could cause an overflow before

Result:

Fix possible overflow on systems that support SO_ACCEPTFILTER
@normanmaurer normanmaurer requested a review from chrisvest March 12, 2026 20:53
@normanmaurer normanmaurer added this to the 4.2.11.Final milestone Mar 12, 2026
@normanmaurer normanmaurer added needs-cherry-pick-4.1 This PR should be cherry-picked to 4.1 once merged. needs-cherry-pick-5.0 This PR should be cherry-picked to 5.0 once merged. labels Mar 12, 2026
@normanmaurer normanmaurer enabled auto-merge (squash) March 13, 2026 08:21
@normanmaurer normanmaurer disabled auto-merge March 13, 2026 08:21
@normanmaurer normanmaurer merged commit 9b09ab3 into 4.2 Mar 13, 2026
23 of 24 checks passed
@normanmaurer normanmaurer deleted the overflow branch March 13, 2026 08:21
netty-project-bot pushed a commit that referenced this pull request Mar 13, 2026
…Filter(...) (#16451)

Motivation:

How we used strncat(...) was incorrect and could produce an overflow as
we did not take the null termination into account. We should better use
strlcat(...) which is safer to use and less error-prone.

Modifications:

- Validate that we will not truncate and so might use the "incorrect
value"
- Use strlcat(...) and so correctly respect the null termination which
could cause an overflow before

Result:

Fix possible overflow on systems that support SO_ACCEPTFILTER

(cherry picked from commit 9b09ab3)
@netty-project-bot

Copy link
Copy Markdown
Contributor

Auto-port PR for 5.0: #16458

@github-actions github-actions Bot removed the needs-cherry-pick-5.0 This PR should be cherry-picked to 5.0 once merged. label Mar 13, 2026
netty-project-bot pushed a commit that referenced this pull request Mar 13, 2026
…Filter(...) (#16451)

Motivation:

How we used strncat(...) was incorrect and could produce an overflow as
we did not take the null termination into account. We should better use
strlcat(...) which is safer to use and less error-prone.

Modifications:

- Validate that we will not truncate and so might use the "incorrect
value"
- Use strlcat(...) and so correctly respect the null termination which
could cause an overflow before

Result:

Fix possible overflow on systems that support SO_ACCEPTFILTER

(cherry picked from commit 9b09ab3)
@netty-project-bot

Copy link
Copy Markdown
Contributor

Auto-port PR for 4.1: #16459

@github-actions github-actions Bot removed the needs-cherry-pick-4.1 This PR should be cherry-picked to 4.1 once merged. label Mar 13, 2026
normanmaurer added a commit that referenced this pull request Mar 13, 2026
…ocket_setAcceptFilter(...) (#16459)

Auto-port of #16451 to 4.1
Cherry-picked commit: 9b09ab3

---
Motivation:

How we used strncat(...) was incorrect and could produce an overflow as
we did not take the null termination into account. We should better use
strlcat(...) which is safer to use and less error-prone.

Modifications:

- Validate that we will not truncate and so might use the "incorrect
value"
- Use strlcat(...) and so correctly respect the null termination which
could cause an overflow before

Result:

Fix possible overflow on systems that support SO_ACCEPTFILTER

Co-authored-by: Norman Maurer <norman_maurer@apple.com>
normanmaurer added a commit that referenced this pull request Mar 13, 2026
…ocket_setAcceptFilter(...) (#16458)

Auto-port of #16451 to 5.0
Cherry-picked commit: 9b09ab3

---
Motivation:

How we used strncat(...) was incorrect and could produce an overflow as
we did not take the null termination into account. We should better use
strlcat(...) which is safer to use and less error-prone.

Modifications:

- Validate that we will not truncate and so might use the "incorrect
value"
- Use strlcat(...) and so correctly respect the null termination which
could cause an overflow before

Result:

Fix possible overflow on systems that support SO_ACCEPTFILTER

Co-authored-by: Norman Maurer <norman_maurer@apple.com>
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.

3 participants