Skip to content

forward_sendfile bypasses shadow_sp for writable shadow destination FDs #64

@ChuWeiChang

Description

@ChuWeiChang

Problem

When the guest application invokes sendfile(), forward_sendfile() in seccomp_dispatch.c incorrectly treats out_fd as physical host_fd when the destination out_fd is a shadowed file descriptor. It fails to check if the destination has an active shadow_sp.

Proposed Solution

Explicitly query the out_fd entry in the FD table before the write loop. If shadow_writeback is enabled and shadow_sp >= 0, extract the shadow_sp and route the sendfile writes to that virtual pointer instead of the raw host FD.

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