Skip to content

Fix missing file identity for SENDFILE, MSYNC, MADVISE - #97

Merged
raflyhangga merged 1 commit into
mainfrom
fix/sendfile-msync-madvise-identity
Jul 27, 2026
Merged

Fix missing file identity for SENDFILE, MSYNC, MADVISE#97
raflyhangga merged 1 commit into
mainfrom
fix/sendfile-msync-madvise-identity

Conversation

@raflyhangga

Copy link
Copy Markdown
Contributor

do_sendfile() only had raw fds available, but the source fd was never propagated into the event or resolved in userspace, so SENDFILE always reported empty inode/filename. msync/madvise wrote their mapping address into the wrong struct field (offset instead of address), so userspace's address-based mmap-region lookup never fired for either op.

  • prober.c: capture SENDFILE's source fd in data.fd; fix msync/madvise to store the address in data.address instead of data.offset.
  • IOTracer.py: resolve SENDFILE via PathResolver.resolve_by_fd(); add a read-only mmap-region lookup (_lookup_region_filename) for MSYNC/MADVISE that doesn't mutate the region cache the way MUNMAP's resolver does, since the mapping stays alive after msync/madvise.
  • Update VFS_EVENTS.md and schema.py to document the new resolution paths, and correct a pre-existing doc claim that fd was a CSV column (it isn't).

do_sendfile() only had raw fds available, but the source fd was never
propagated into the event or resolved in userspace, so SENDFILE always
reported empty inode/filename. msync/madvise wrote their mapping address
into the wrong struct field (offset instead of address), so userspace's
address-based mmap-region lookup never fired for either op.

- prober.c: capture SENDFILE's source fd in data.fd; fix msync/madvise
  to store the address in data.address instead of data.offset.
- IOTracer.py: resolve SENDFILE via PathResolver.resolve_by_fd(); add a
  read-only mmap-region lookup (_lookup_region_filename) for MSYNC/MADVISE
  that doesn't mutate the region cache the way MUNMAP's resolver does,
  since the mapping stays alive after msync/madvise.
- Update VFS_EVENTS.md and schema.py to document the new resolution paths,
  and correct a pre-existing doc claim that fd was a CSV column (it isn't).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@raflyhangga
raflyhangga merged commit 87ac9c9 into main Jul 27, 2026
4 checks passed
@raflyhangga
raflyhangga deleted the fix/sendfile-msync-madvise-identity branch July 27, 2026 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant