security: add total sample cache size limit in PulseAudio protocol

There was no limit on the total size of the sample cache. A client
could upload many samples to exhaust server memory. Add a configurable
pulse.max-sample-cache property (default 64MB) to cap the total size
of all cached samples.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Wim Taymans 2026-04-29 16:39:57 +02:00
parent 37990b5e90
commit 52afec565b
5 changed files with 18 additions and 0 deletions

View file

@ -38,6 +38,7 @@
#define MAX_NAME 1024u
#define SCACHE_ENTRY_SIZE_MAX (1024*1024*16)
#define MAX_SAMPLE_CACHE (1024u*1024*64) /* 64MB */
#define MAX_CLIENTS 64u
#define MAX_STREAMS 64u