| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
No issues found across 1 file
Confidence score: 5/5
sequenceDiagram
participant RE as RRDEngine
participant J2 as JournalV2 (mmap)
participant Mem as Protected Memory Area
participant Log as Logger
Note over RE, Mem: Retention Scan: find_uuid_first_time loop
RE->>J2: NEW: journalfile_v2_data_acquire_with_hint()
J2-->>RE: Return j2_header pointer & NEW: journal_v2_file_size
alt Header acquisition failed
RE->>RE: Skip to next datafile
end
RE->>RE: PROTECTED_ACCESS_SETUP (mmap guards)
alt Access Signal (SIGBUS/SIGSEGV) or no_signal_received is false
RE->>Log: CHANGED: "failed to access journalfile"
else Access Successful
RE->>Mem: CHANGED: Read header fields (start_time, offsets, count)
Note over RE: NEW: Strict Bounds Validation
RE->>RE: Check __builtin_mul_overflow(metric_count, size)
alt NEW: Validation Error (Offset/Size > File Size)
RE->>Log: NEW: "metric list exceeds journal file size"
RE->>RE: Set journal_access_failed = true
else Validation Success
loop For each UUID entry
RE->>RE: NEW: Check if journal_search_start >= metric_count
RE->>Mem: Access uuid_list[index]
Note right of Mem: Binary search or direct access
end
end
end
RE->>J2: journalfile_v2_data_release()
opt NEW: Access Failure skip
RE->>RE: Skip early-release logic
RE->>RE: Continue to next datafile
end
RE->>RE: datafile_release_and_acquire_next_for_retention()
Sorry, something went wrong.
There was a problem hiding this comment.
This PR adjusts rrdengine’s journal v2 scanning so journal header fields are accessed only after PROTECTED_ACCESS_SETUP, and adds additional bounds validation when walking the journal metric list (to better handle corrupted/unreadable journal files).
Changes:
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
There was a problem hiding this comment.
Note
Copilot was unable to run its full agentic suite in this review.
Improves robustness of journal v2 file access during retention scanning by performing header/metric list validation under protected access and skipping truncated/invalid journals safely.
Changes:
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
There was a problem hiding this comment.
Hardens journal v2 access during DBENGINE retention scanning by moving header-derived reads under protected access and validating metric directory bounds against the mapped file size to avoid out-of-bounds access on truncated/corrupt journals.
Changes:
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
|
Sorry, something went wrong.
There was a problem hiding this comment.
No issues found during runtime, LGTM!
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
Summary by cubic
Hardened journal file access in the retention scan and simplified the search loop to avoid invalid indexing. Prevents out-of-bounds reads and cleanly skips truncated or invalid journals.
Written for commit 7870cb2. Summary will update on new commits. Review in cubic