Skip to content

[WIP] Add mprotect syscall events#367

Draft
Aegrah wants to merge 4 commits into
elastic:mainfrom
Aegrah:aegrah/mprotect-events
Draft

[WIP] Add mprotect syscall events#367
Aegrah wants to merge 4 commits into
elastic:mainfrom
Aegrah:aegrah/mprotect-events

Conversation

@Aegrah

@Aegrah Aegrah commented Jul 17, 2026

Copy link
Copy Markdown

Summary

Collect sys_enter_mprotect through eBPF and expose the address, length, and raw protection mask as a new Quark event.

The probe requires both PROT_READ and PROT_WRITE before ring-buffer submission; execute and other modifier bits remain optional. quark-mon -u prints the mask in stable R/W/X order. This event is eBPF-only; no kprobe fallback is added.

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

Verification

  • Quark build and t_mprotect: PASS
  • Tests exercise every mask from 0 through 7; only RW and RWX are observed
  • Full preflight: 20260720T164000Z-mprotect-pr-ready-preflightPASS
  • Fleet acceptance on Stack/Agent/Endpoint 9.4.2: 20260720T181500Z-mprotect-pr-ready-acceptancePASS
  • Elasticsearch accepted RW/RWX and rejected masks missing read or write

Observed workload:

MPRO addr=0x... len=4096 prot=0x3 (RW)
MPRO addr=0x... len=4096 prot=0x7 (RWX)

Companion PRs

Aegrah and others added 2 commits July 17, 2026 16:55
Collect only read-write protection changes to keep event volume bounded while exposing raw and decoded protection data to consumers.

Co-authored-by: Cursor <cursoragent@cursor.com>
Preserve the new CLOCK_BOOTTIME contract while moving the mprotect queue flag to the next available bit.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Aegrah
Aegrah requested a review from nicholasberlin July 20, 2026 08:06
@Aegrah Aegrah self-assigned this Jul 20, 2026
@Aegrah Aegrah added the enhancement New feature or request label Jul 20, 2026
@Aegrah Aegrah changed the title Add mprotect syscall events [WIP] Add mprotect syscall events Jul 20, 2026
Aegrah and others added 2 commits July 20, 2026 12:03
Exercise every suppressed protection mask and keep the public event representation and documentation consistent.

Co-authored-by: Cursor <cursoragent@cursor.com>
Describe the permission-bit filter without implying that optional protection modifiers are rejected.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant