mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-04-30 06:46:49 -04:00
security: validate packet length in AVB get_avb_info handler
Memory Safety: High The handle_get_avb_info_common() function copied network packet data into a stack buffer using memcpy(buf, m, len) without validating that len fits within the 2048-byte buffer. A crafted AVB packet with a large length could overflow the stack buffer. Added bounds validation matching the pattern already used in handle_read_descriptor_common(). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
46eefd16ee
commit
88a3bf8aab
1 changed files with 3 additions and 0 deletions
|
|
@ -151,6 +151,9 @@ static int handle_get_avb_info_common(struct aecp *aecp, int64_t now,
|
|||
if (desc_type != AVB_AEM_DESC_AVB_INTERFACE || desc_id != 0)
|
||||
return reply_not_implemented(aecp, m, len);
|
||||
|
||||
if (len < 0 || (size_t)len > sizeof(buf))
|
||||
return reply_status(aecp, AVB_AECP_AEM_STATUS_BAD_ARGUMENTS, m, len);
|
||||
|
||||
avb_interface = desc->ptr;
|
||||
|
||||
memcpy(buf, m, len);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue