Skip to content

core: recover from panics while formatting a PDR for logging - #640

Open
SAY-5 wants to merge 4 commits into
edgecomllc:mainfrom
SAY-5:fix-sdf-filter-display-panic
Open

SAY-5 wants to merge 4 commits into
edgecomllc:mainfrom
SAY-5:fix-sdf-filter-display-panic

Conversation

@SAY-5

@SAY-5 SAY-5 commented Aug 26, 2026 •

Copy link
Copy Markdown

displayPdr calls into go-pfcp's SDFFilter() while logging a session establishment/modification request. If the SDF Filter's Flow-Description length lies about how many bytes follow (0xFFFE/0x7FFF with only a few actual bytes), go-pfcp v0.0.23 slices past the buffer and panics, taking the whole UPF down over a logging call. Fixes #638.

Added a recover around displayPdr so a bad IE only drops that log line instead of crashing the process, and a test that builds exactly this malformed SDF Filter and calls displayPdr directly. I confirmed the panic against the pinned go-pfcp dependency itself first (slice bounds out of range [:65538] with capacity 5) before writing the fix. cmd/core also imports the eBPF bindings that this repo generates via bpf2go/clang/libbpf in CI, so I couldn't build the full package locally on macOS to run the new test myself, but it exercises the same code path your CI already runs under go test ./cmd/....

This branch has not been deployed

No deployments
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