Commit graph

11 commits

Author SHA1 Message Date
hackerman-kl
5355671022 milan-avb: mrp: fix REG log notify label 2026-04-27 10:56:44 +00:00
Wim Taymans
918d0f2f8a security: validate packet bounds in AVB MRP protocol parser
Input Validation: High

The avb_mrp_parse_packet() function, used by both MSRP and MVRP
protocol handlers, had several missing bounds checks:

1. No minimum length validation: the parser began accessing packet
   data at sizeof(avb_packet_mrp) without checking len was large
   enough, causing out-of-bounds reads on truncated packets.

2. Unsafe loop terminator checks: the while loops checked m[0] and
   m[1] without ensuring at least 2 bytes remained in the buffer.

3. Missing hdr_size bounds check: the header size returned by the
   check_header callback was used to advance the pointer without
   verifying it stayed within the packet bounds.

Fix by adding a minimum packet length check, using structure-size-aware
bounds checks in loop conditions, and validating hdr_size against
remaining packet data before advancing the pointer.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-27 12:37:51 +02:00
Christian F.K. Schaller
1d0c51f057 module-avb: fix MRP NEW messages never being transmitted
AVB_MRP_SEND_NEW was defined as 0, making it indistinguishable from
"no pending send" in the MSRP and MVRP event handlers which check
`if (!pending_send)`. This meant that when an attribute was first
declared (applicant state VN or AN), the NEW message was silently
dropped instead of being transmitted on the network.

Fix by shifting all AVB_MRP_SEND_* values to start at 1, so that 0
unambiguously means "no send pending". Update the MSRP and MVRP
encoders to subtract 1 when encoding to the IEEE 802.1Q wire format
(which uses 0-based event values).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 07:43:19 +00:00
hackerman-kl
c10f869836 module-avb: mrp: cleaning allocated attribute on destroy 2025-12-01 09:08:26 +00:00
hackerman-kl
f2093a3f76 module-avb: mrp: fix leavall timer issue, introducing lva state machine 2025-11-21 08:24:44 +00:00
hackerman-kl
03428f3380 module-avb: mrp: add human readable m*rp states 2025-11-21 08:24:44 +00:00
Barnabás Pőcze
934ab3036e treewide: use SPDX tags to specify copyright information
SPDX tags make the licensing information easy to understand and clear,
and they are machine parseable.

See https://spdx.dev for more information.
2023-02-16 10:54:48 +00:00
Wim Taymans
f043922b24 avb: implement maap
Implement the maap state machine.
Use maap for the destination address of talker streams.
2022-07-12 12:27:22 +02:00
Wim Taymans
e0d6b2bb4f avb: implement streams
Add in input/output stream, setup the talker/listeners.
Implement IEC61883 audio packets, send and receive data.
Implement talker encoding.

With this, audio can be sent and received from MOTU M64.
2022-07-12 12:27:22 +02:00
Wim Taymans
9a26df3478 avb: improve state machine
Emit per attribute callbacks.
Notify events immediately.
2022-07-12 12:27:22 +02:00
Wim Taymans
773bd610aa avb: avbtp -> avb 2022-07-12 12:27:22 +02:00
Renamed from src/modules/module-avbtp/mrp.c (Browse further)