Skip to content

Add process_vm_access events for process_vm_readv/writev - #376

Draft
Aegrah wants to merge 5 commits into
elastic:mainfrom
Aegrah:process-vm-writev-readv
Draft

Add process_vm_access events for process_vm_readv/writev#376
Aegrah wants to merge 5 commits into
elastic:mainfrom
Aegrah:process-vm-writev-readv

Conversation

@Aegrah

@Aegrah Aegrah commented Aug 7, 2026

Copy link
Copy Markdown

Summary

Emit process_vm_access when a process uses process_vm_readv or process_vm_writev to access another process's memory. Events carry the operation, target PID, first remote address, requested byte count, and raw syscall return value so Defend can distinguish successful transfers from failed attempts. Same-process calls are suppressed.

Issue: https://github.com/elastic/endpoint-dev/issues/21204

  • Hook/backend: paired sys_enter/sys_exit_process_vm_{readv,writev} tracepoints, eBPF-only
  • Completion/state: bounded per-thread state correlates entry arguments with the raw syscall return value at exit
  • Event/flag: QUARK_EV_PROCESS_VM_ACCESS, QQ_PROCESS_VM_ACCESS
  • Compatibility: same-process calls are suppressed; successful and failed cross-process calls are emitted; no kprobe fallback

Proof

  • Build: PASS (make + clang-17)
  • Sensor test: t_process_vm_access PASS (read/write events present; same-process calls absent)
  • Cold Fleet acceptance: 20260731T222145Z-process-vm-access (9.4.2)
  • Persona volume gate: 20260802T092603Z-process-vm-access-volume on endpoint-9.4.2-ac8c21cfbdbcac3d (PASS, 4h; 0 target docs/h as expected)

Aegrah and others added 2 commits August 7, 2026 18:30
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@Aegrah
Aegrah marked this pull request as ready for review August 7, 2026 18:52
@Aegrah
Aegrah requested a review from a team as a code owner August 7, 2026 18:52
@Aegrah Aegrah closed this Aug 7, 2026
@Aegrah Aegrah reopened this Aug 7, 2026
@Aegrah
Aegrah marked this pull request as draft August 7, 2026 20:01
Exclude the process VM access test alongside the existing RHEL 9.3 exclusions because that kernel has the same unreliable syscall tracepoint behavior seen by mprotect.

Co-authored-by: Cursor <cursoragent@cursor.com>
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