Commit graph

15255 commits

Author SHA1 Message Date
hackerman-kl
fc08d2444a milan-avb: gptp: send PTP management with majorSdoId=1 for gPTP profile 2026-05-03 10:26:16 +02:00
hackerman-kl
1b81dbab85 milan-avb: adding the ptp4l command line information 2026-05-03 10:26:16 +02:00
hackerman-kl
4b44c15768 milan-avb; introducing gptp/as_path interface specific dirty flags 2026-05-03 10:26:16 +02:00
hackerman-kl
21dd14618c milan-avb: update banner 2026-05-03 10:26:16 +02:00
hackerman-kl
46f9c5130e milan-avb: cmd-get-as-path: build path from gptp data 2026-05-03 10:26:16 +02:00
hackerman-kl
9f019a061d milan-avb: aecp-aem: source GET_AVB_INFO grandmaster from gptp 2026-05-03 10:26:16 +02:00
hackerman-kl
e9a1e50996 milan-avb: adp: refresh grandmaster_id from gptp on each advertise 2026-05-03 10:26:16 +02:00
hackerman-kl
231b0950c5 milan-avb: descriptors: derive AVB_INTERFACE clock_identity from entity_id 2026-05-03 10:26:16 +02:00
hackerman-kl
3f63b51fcc milan-avb: gptp: rework management I/O as non-blocking with sequence-id matching 2026-05-03 10:26:16 +02:00
hackerman-kl
0da747fd44 milan-avb: gptp: do not fail server creation on missing PTP socket 2026-05-03 10:26:16 +02:00
hackerman-kl
0b09fb2b1e milan-avb: gptp: initialise ret in the drain loop 2026-05-03 10:26:16 +02:00
hackerman-kl
21c4c59587 milan-avb: gptp: use entity_id for management source port id 2026-05-03 10:26:16 +02:00
hackerman-kl
1e9f89b638 milan-avb: gptp: emit gm_changed only when the GM actually changes 2026-05-03 10:26:16 +02:00
hackerman-kl
f5389a4225 milan-avb: gptp: drop unused avb_gptp_destroy wrapper 2026-05-03 10:26:16 +02:00
hackerman-kl
8c9e5f1974 milan-avb: gptp: use PTP_DEFAULT_LOG_MESSAGE_INTERVAL macro 2026-05-03 10:26:16 +02:00
hackerman-kl
e83bbfacf1 milan-avb: gptp: drop %m from incomplete request/response warnings 2026-05-03 10:26:16 +02:00
hackerman-kl
d5e4f11be7 milan-avb: gptp: fix log message for SO_PASSCRED setsockopt failure 2026-05-03 10:26:16 +02:00
hackerman-kl
51a997294e milan-avb: gptp: drop unused struct fields 2026-05-03 10:26:16 +02:00
hackerman-kl
7f687cae77 milan-avb: gptp: drop unused includes 2026-05-03 10:26:16 +02:00
hackerman-kl
b197ae79c5 milan-avb: gptp: align code style with the rest of module-avb 2026-05-03 10:26:16 +02:00
Nils Tonnaett
0345623e97 module-avb: remove redundant init_descriptors() call 2026-05-03 10:26:16 +02:00
Nils Tonnaett
37efd5c5f9 module-avb: emit gm_changed event 2026-05-03 10:26:16 +02:00
Nils Tonnaett
5fd9c1eaff module-avb: fail if ptp management socket can't be created 2026-05-03 10:26:16 +02:00
Nils Tonnaett
bf6fae7df9 module-avb: fail if ptp.management-socket not set 2026-05-03 10:26:16 +02:00
Nils Tonnaett
f4c26cd3ed module-avb: check that ptp management request is complete 2026-05-03 10:26:16 +02:00
Nils Tonnaett
f360af0889 module-avb: check return value of read when clearing ptp_fd input buffer 2026-05-03 09:49:22 +02:00
Nils Tonnaett
c8f2edd94e module-avb: check ioctl for success 2026-05-03 09:49:22 +02:00
Nils Tonnaett
07533eb590 module-avb: check that PTP management response is complete 2026-05-03 09:49:22 +02:00
Nils Tonnaett
6c43bdfa85 module-avb: htobe16/be16toh to htons/ntohs 2026-05-03 09:49:22 +02:00
Nils Tonnaett
16189ae167 module-avb: add specs comments for PTP management message format 2026-05-03 09:49:22 +02:00
Nils Tonnaett
fc6f2e33e2 module-avb: close ptp_fd when destroyed 2026-05-03 09:49:22 +02:00
Nils Tonnaett
f752653814 module-avb: free gptp->ptp_mgmt_socket_path 2026-05-03 09:49:22 +02:00
Nils Tonnaett
54a9495715 module-avb: check ptp management socket periodically 2026-05-03 09:49:22 +02:00
Nils Tonnaett
4bc365cbb5 module-avb: add avb interface descriptor defines 2026-05-03 09:49:22 +02:00
Wim Taymans
f29d7875cf connection: reject too large messages
Instead of silently truncating the message size in the header, simply
reject the complete message.
2026-05-01 13:04:02 +02:00
Wim Taymans
ceb80723a9 modules: unset buffer and size after alloc failure
Set the buffer_data to NULL and the size to 0 after we free the
buffer in realloc failure to avoid problems later.
2026-05-01 13:02:00 +02:00
Wim Taymans
a4fb06073c modules: protect against invalid input and 0 division
Don't crash when the AEC reported latency is invalid.

Check that the parsed values make sense and avoid division by 0.
2026-05-01 12:42:53 +02:00
Wim Taymans
6f6b58785e modules: handle allocation errors 2026-05-01 12:29:54 +02:00
Wim Taymans
a55546c9df filter-chain: limit the number of graph in/out
There is no limit on the number of inputs/outputs of a graph but the
filter-chain assumes it is at most 128 and also that there are at most
128 buffer datas.

Increase the limit (1024) and clamp and log an error when the
filter-graph has more channels. Also clamp the buffer datas so that we
don't overflow the stack allocated buffers.
2026-05-01 12:29:12 +02:00
Wim Taymans
6cc92c0e2b security: add missing NULL checks and fix error handling in modules
module-access: add NULL check after pw_properties_new for
socket_access.

module-pulse-tunnel: add NULL check after 4MB calloc for ring
buffer.

module-rt: add NULL check after calloc in thread create.

module-rtp-session: add goto error after failed
pw_net_parse_address instead of falling through.

module-snapcast-discover: fix missing null-termination on
network-received data before logging it as a string.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-30 18:38:32 +02:00
Wim Taymans
47ca937905 fix capture rate assignment using logical NOT instead of copy
Three modules had "impl->capture_info.rate = !impl->playback_info.rate"
which evaluates to 0 (logical NOT of a non-zero rate) instead of
copying the playback rate. This is a copy-paste typo from the line
above which correctly uses "= impl->capture_info.rate".

Affects module-filter-chain, module-loopback, module-example-filter.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-30 18:38:26 +02:00
Wim Taymans
4b64b81d21 security: fix crash and overflow bugs in network-facing modules
module-filter-chain: fix NULL pointer dereference when
pw_stream_dequeue_buffer returns NULL and out->requested is
accessed outside the NULL check.

module-zeroconf-discover: add NULL checks for name, type,
host_name, address, and port from mDNS lookups that could be
missing in malformed announcements.

module-raop-sink: cap net.mtu to 9000 to prevent stack overflow
via VLA uint32_t out[8 + mtu].

module-rtp-sap: fix buffer over-read in SDP "i=" line parsing
that read past a self-inserted null terminator. Also fix fd leak
when fd is 0 (fd > 0 should be fd >= 0).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-30 18:38:19 +02:00
Wim Taymans
c551408ec2 security: reject path traversal in echo-cancel aec_method parameter
The aec_method parameter is interpolated into a SPA library path
as "aec/libspa-aec-%s". A client could use "../" sequences to
load arbitrary SPA plugins. Reject values containing ".." or "/".

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-30 17:44:28 +02:00
Wim Taymans
5d0e806bdb security: limit blocklist regex length in switch-on-connect module
A PulseAudio client can load this module with an arbitrarily complex
blocklist regex, causing catastrophic backtracking in regexec on
every new device. Cap the regex string at 1024 characters.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-30 17:40:25 +02:00
Wim Taymans
dac6b4f2c5 security: clamp negative max-clients config to zero in pulse server
A negative max-clients value in the config is parsed as int then
assigned to uint32_t, wrapping to UINT32_MAX and effectively
disabling the client limit.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-30 17:28:02 +02:00
Wim Taymans
c38a32e2e1 security: fix NULL pointer dereference in LADSPA sink/source modules
When sink_name/source_name is not provided, pw_properties_get for
PW_KEY_NODE_NAME returns NULL, which is then passed to
pw_properties_setf as a %s argument.

Add NULL check before calling pw_properties_setf.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-30 17:24:52 +02:00
Wim Taymans
99a89f8bd4 security: fix stack overflow via strndupa on long device names
A client-supplied device name ending in ".monitor" was stack-allocated
via strndupa without any size limit. Since protocol messages can be up
to 16MB, a malicious client could send a very long device name and
overflow the stack, crashing the daemon.

Cap the strndupa length at MAX_NAME (1024) in both find_device and
do_set_default.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-30 17:18:06 +02:00
Wim Taymans
6ea673b68a security: fix issues in pulse module core files
- volume.c: add spa_pod_is_object check before casting param to
  spa_pod_object, preventing out-of-bounds reads on malformed pods
- manager.c: add NULL check for p->param in has_param before
  dereferencing via SPA_POD_SIZE
- snap-policy.c: check strings1[1] and strings2[1] for NULL before
  passing to g_str_equal, fixing wrong operand order
- format.c: use map->channels consistently in format_build_param

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-30 17:08:04 +02:00
Wim Taymans
ef2541a1ef security: fix multiple issues in pulse module implementations
- module-zeroconf-publish: guard spa_hook_remove of impl_listener with
  a flag to prevent operating on uninitialized hook when unload is called
  after a partial load failure; bail out of create_service when
  pw_properties_new fails to prevent NULL dereference in publish_service
- module-device-restore: add missing NULL check after message_alloc in
  emit_event; make manager_events static const
- module-jackdbus-detect: fix memory leak on error paths in prepare by
  using goto out instead of early return; free props/sink_props/source_props
  in unload
- module-roc-sink-input: add missing valid_args whitelist
- module-rtp-recv: add missing valid_args whitelist
- module-rtp-send: add missing valid_args whitelist
- module-gsettings: add missing NULL check after strdup in load_group

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-30 16:50:30 +02:00
Wim Taymans
8e596bd85f impl-link: handle copy errors 2026-04-30 16:41:43 +02:00