Skip to content

Conversation

@JordanYates
Copy link
Contributor

Validate that the file descriptor is not a negative number before writing to the dispatch_table ctx field. Setting file descriptors to -1 is the standard "not in use" value, and in fact the entire array of fds is set to this value in dns_resolve_init_locked. This resolves memory corruption of whichever variable is unfortunate to exist just before dispatch_table in memory.

Validate that the file descriptor is not a negative number before
writing to the `dispatch_table` `ctx` field. Setting file descriptors
to `-1` is the standard "not in use" value, and in fact the entire array
of `fds` is set to this value in `dns_resolve_init_locked`. This
resolves memory corruption of whichever variable is unfortunate to exist
just before `dispatch_table` in memory.

Signed-off-by: Jordan Yates <jordan@embeint.com>
@sonarqubecloud
Copy link

@kartben kartben merged commit 0f1d7d3 into zephyrproject-rtos:main May 14, 2025
31 checks passed
@JordanYates JordanYates deleted the 250512_dns_oob_access branch May 14, 2025 21:14
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.

5 participants