Skip to content

copy stat entry name off shared memory region#352

Merged
sknat merged 2 commits intoFDio:masterfrom
bor1go:avoid-returning-shmem
Apr 16, 2026
Merged

copy stat entry name off shared memory region#352
sknat merged 2 commits intoFDio:masterfrom
bor1go:avoid-returning-shmem

Conversation

@bor1go
Copy link
Copy Markdown
Contributor

@bor1go bor1go commented Mar 26, 2026

GetStatDirOnIndex returned a dirName slice backed directly by the mmap'd statseg region. If VPP unmaps the segment (e.g. on shutdown) after DumpStats returns but before the caller reads the name, any access causes a hardware fault.

Clone to ensure the returned slice is heap-allocated and safe to use after disconnect.

Georgy Borodin and others added 2 commits March 26, 2026 18:25
GetStatDirOnIndex returned a dirName slice backed directly by the
mmap'd statseg region. If VPP unmaps the segment (e.g. on shutdown)
after DumpStats returns but before the caller reads the name, any
access causes a hardware fault. Use bytes.Clone to ensure the
returned slice is heap-allocated and safe to use after disconnect.
Copy link
Copy Markdown
Contributor

@sknat sknat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks !

@sknat sknat merged commit 2d1eb46 into FDio:master Apr 16, 2026
11 checks passed
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.

2 participants