Skip to content

Fix incorrect I/O log base offsets in logsrvd - #562

Open
Z-Bra0 wants to merge 1 commit into
sudo-project:mainfrom
Z-Bra0:main
Open

Z-Bra0 wants to merge 1 commit into
sudo-project:mainfrom
Z-Bra0:main

Conversation

@Z-Bra0

@Z-Bra0 Z-Bra0 commented Oct 12, 2026

Copy link
Copy Markdown

logsrvd generates relative log IDs using the length of iolog_base, derived from the configured directory. Path expansion can shorten that directory by collapsing %%, collapsing repeated leading slashes, or removing trailing slashes. This mismatch can produce an incorrect relative path or an out-of-bounds read during log-ID generation.

Stop the base at a directory boundary before the first % escape and normalize its leading and trailing slashes consistently with path expansion. Keep expanded components in the relative log ID so reconnects reconstruct the correct path.

Add regression coverage for literal percent escapes, date and named escapes, repeated slashes, and root directories. Tests verify base extraction, offset bounds, and reconnect path reconstruction.

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