libkernel: a descriptor that is not open hides the address argument errors of bind, connect and sendto #8391
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-20T12:03:43Z.
Repro
bind(-1, addr, 1),bind(-1, addr, 256),bind(-1, NULL, 16),connect(-1, addr, 1),sendto(-1, "x", 1, 0, addr, 1).Expected (FreeBSD 11.4 sys/kern/uipc_syscalls.c
:194, :549, :765-766): EINVAL, ENAMETOOLONG, EFAULT, EINVAL, EINVAL, because the address (getsockaddr`) is examined before the descriptor is looked up.Actual: EBADF for all of them.
Test: core/libs/tests/GuestSocketAddressLength.cpp. Fix branch: https://github.com/xXPBSXx/AnyPS5/tree/fix/socket-argument-order-fb. AI-assisted (Claude Code).