cloudfoundry / cloudfoundry/loggregator-agent-release
Syslog agent panics when a valid Cloud Foundry task name exceeds RFC5424 PROCID capacity
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 14
- Forks
- 34
- Avg merge
- 7h 6m
- Merged PRs (30d)
- 2
Description
Summary
The loggr-syslog-agent panics when processing logs from a Cloud Foundry task
with a long task name.
The task name is accepted as valid metadata by Cloud Controller. However, the
name is propagated through Loggregator as part of source_type and is later
used to construct the RFC5424 PROCID field.
Observed behavior
The syslog agent crashes with:
panic: runtime error: slice bounds out of range [:-40]
The panic occurs in:
src/pkg/egress/syslog/tcp.go
The relevant code is:
sourceInstance = sourceInstance[:(128 - len(sourceType) - 3)]
Expected behavior
A valid Cloud Foundry task name must not be able to crash the syslog agent.
The syslog agent should:
- safely truncate the complete generated
PROCIDto the RFC5424 limit, or - reject/drop only the affected message and continue processing.
The agent process must remain running.
Impact
A single task with a sufficiently long name can cause the syslog agent on a
Diego Cell to restart. This can interrupt or impair delivery to configured
syslog drains and may cause message loss during the restart.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/pkg/egress/syslog/tcp.go at the sourceInstance slicing shown in the report, then trace the surrounding PROCID construction. Exercise processing with a valid Cloud Foundry task name longer than the RFC5424 capacity. Done means the generated PROCID is handled safely and the agent continues running instead of panicking.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- devops
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100