Branch: refs/heads/misc-bugfixes
Home: https://github.com/kronosnet/kronosnet
Commit: de432cac4dd448962ee6fb7c532e150365f3f0be
https://github.com/kronosnet/kronosnet/commit/de432cac4dd448962ee6fb7c532e1…
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
Date: 2026-05-28 (Thu, 28 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), all pipes (bidirectional flow requires two fds),
and unconnected/unbound sockets.
Add comprehensive test coverage with both blacklist (rejection) and
whitelist (acceptance) tests for various fd types including a SOCK_DGRAM
test that validates knet I/O by sending through knet_send and receiving
on the peer socket.
Platform-specific handling:
- Linux: Character devices fail with EPERM at epoll stage
- Older BSD (13/14): Character devices fail with ENODEV at kqueue stage
- Newer BSD (15+) and Solaris: Character devices accepted
Signed-off-by: Fabio M. Di Nitto <fabbione(a)kronosnet.org>
Co-Authored-By: Claude Sonnet 4.5 <noreply(a)anthropic.com>
To unsubscribe from these emails, change your notification settings at https://github.com/kronosnet/kronosnet/settings/notifications