Automattic / Automattic/kandelo

kernel: roll back non-pipe SCM_RIGHTS installs on descriptor exhaustion

Open
#950 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
31
Forks
15
Avg merge
11h 7m
Merged PRs (30d)
80

Description

## 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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in crates/kernel/src/wasm_api.rs at install_scm_rights_fds, then compare the non-pipe PTY and ordinary-file paths with the rollback behavior from #949. Add guest coverage that fills the receiver descriptor table and exercises recvmsg with passed descriptors. Done means failed installs release the OFD, undo PTY references, report ancillary truncation consistently, and leave no hidden lifetime.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, wasm
Domain
operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.