Branch: refs/heads/misc-bugfixes Home: https://github.com/kronosnet/kronosnet Commit: a1b107f53d97c03fa24e5171c21a931b157b295a https://github.com/kronosnet/kronosnet/commit/a1b107f53d97c03fa24e5171c21a93... Author: Fabio M. Di Nitto fdinitto@redhat.com Date: 2026-05-27 (Wed, 27 May 2026)
Changed paths: M libknet/handle_api.c M libknet/libknet.h M libknet/tests/api_knet_handle_add_datafd.c
Log Message: ----------- libknet: add comprehensive file descriptor validation in knet_handle_add_datafd
Add validation to reject unsupported file descriptor types that would fail at runtime. Reject user-provided AF_UNIX socketpairs (knet needs both ends but API only accepts one), unidirectional pipes, and unconnected/unbound sockets.
Add comprehensive test coverage with both blacklist (rejection) and whitelist (acceptance) tests for various fd types.
Platform-specific handling: - Linux: Detect and reject unidirectional pipes via fcntl(F_GETFL) check - BSD/Solaris: Skip pipe direction check (pipes are bidirectional) - Solaris: Handle getpeername() returning addrlen=0 for socketpairs
Signed-off-by: Fabio M. Di Nitto fabbione@kronosnet.org Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com
To unsubscribe from these emails, change your notification settings at https://github.com/kronosnet/kronosnet/settings/notifications