Skip to content

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

Description

@brandonpayton

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions