Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vmm, virtio-devices: allow mremap for consoles #5506

Merged
merged 1 commit into from
Jun 13, 2023

Conversation

alyssais
Copy link
Contributor

SerialBuffer uses VecDeque::extend, which calls realloc, which a maximum buffer size of 1 MiB. Starting at allocation sizes of 128 KiB, musl's mallocng allocator will use mremap for the allocation. Since this was not permitted by the seccomp rules, heavy write load could crash cloud-hypervisor with a seccomp failure. (Encountered using virtio-console, but I don't see any reason it wouldn't happen for the legacy serial device too.)

SerialBuffer uses VecDeque::extend, which calls realloc, which a
maximum buffer size of 1 MiB.  Starting at allocation sizes of
128 KiB, musl's mallocng allocator will use mremap for the allocation.
Since this was not permitted by the seccomp rules, heavy write load
could crash cloud-hypervisor with a seccomp failure.  (Encountered
using virtio-console, but I don't see any reason it wouldn't happen
for the legacy serial device too.)

Signed-off-by: Alyssa Ross <hi@alyssa.is>
@alyssais alyssais requested a review from a team as a code owner June 13, 2023 08:54
@likebreath likebreath merged commit beed5e5 into cloud-hypervisor:main Jun 13, 2023
21 checks passed
@likebreath likebreath added the bug-fix Bug fix to include in release notes label Jun 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-fix Bug fix to include in release notes
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants