Problem
The PTY and ordinary-file branches of SCM_RIGHTS receive create a new open-file description before allocating the receiver file descriptor. When that allocation fails because the receiver table is full, those branches do not decrement the new OFD. The PTY branch also increments the PTY endpoint reference before allocation and does not undo it.
The pipe and socket branches now roll back correctly in #949, but this older non-pipe path remains at crates/kernel/src/wasm_api.rs in install_scm_rights_fds.
Expected behavior
When recvmsg cannot install a passed PTY or ordinary-file descriptor:
- release the newly created OFD;
- undo any PTY endpoint reference increment;
- report ancillary truncation consistently;
- leave no hidden descriptor or global endpoint lifetime behind;
- add real guest coverage for full receiver descriptor tables.
Keep this separate from #949 so the named-pipe prerequisite remains focused and reviewable.
Problem
The PTY and ordinary-file branches of SCM_RIGHTS receive create a new open-file description before allocating the receiver file descriptor. When that allocation fails because the receiver table is full, those branches do not decrement the new OFD. The PTY branch also increments the PTY endpoint reference before allocation and does not undo it.
The pipe and socket branches now roll back correctly in #949, but this older non-pipe path remains at crates/kernel/src/wasm_api.rs in install_scm_rights_fds.
Expected behavior
When recvmsg cannot install a passed PTY or ordinary-file descriptor:
Keep this separate from #949 so the named-pipe prerequisite remains focused and reviewable.