mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-05-04 06:46:24 -04:00
security: add per-client stream limit in PulseAudio protocol
There was no limit on the number of streams a single client could create. Each stream allocates a 4MB ring buffer, allowing a malicious client to exhaust server memory. Add a configurable pulse.max-streams property (default 64) to limit streams per client. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
80ec1f1d10
commit
37990b5e90
7 changed files with 18 additions and 1 deletions
|
|
@ -63,6 +63,11 @@ struct stream *stream_new(struct client *client, enum stream_type type, uint32_t
|
|||
struct defs *defs = &client->impl->defs;
|
||||
const char *str;
|
||||
|
||||
if (pw_map_get_size(&client->streams) >= defs->max_streams) {
|
||||
errno = ENOSPC;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct stream *stream = calloc(1, sizeof(*stream));
|
||||
if (stream == NULL)
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue