Re: [PATCH net-next v3] net: mctp: don't require received header reserved bits to be zero

From: Paolo Abeni

Date: Thu Apr 16 2026 - 04:35:22 EST


On 4/13/26 10:03 AM, wit_yuan wrote:
> From: Yuan Zhaoming <yuanzm2@xxxxxxxxxx>
>
> From the MCTP Base specification (DSP0236 v1.2.1), the first byte of
> the MCTP header contains a 4 bit reserved field, and 4 bit version.
>
> On our current receive path, we require those 4 reserved bits to be
> zero, but the 9500-8i card is non-conformant, and may set these
> reserved bits.
>
> DSP0236 states that the reserved bits must be written as zero, and
> ignored when read. While the device might not conform to the former,
> we should accept these message to conform to the latter.
>
> Relax our check on the MCTP version byte to allow non-zero bits in the
> reserved field.
>
> Signed-off-by: Yuan Zhaoming <yuanzm2@xxxxxxxxxx>

The net-next tree is currently closed for the merge window, but IMHO
this change could be considered a fix. Please repost for 'net' and add a
suitable fixes tag.

> ---
> v2: https://lore.kernel.org/netdev/20260410144339.0d1b289a@xxxxxxxxxx/T/#t
> v1: https://lore.kernel.org/netdev/ff147a3f0d27ef2aa6026cc86f9113d56a8c61ac.camel@xxxxxxxxxxxxxxxxxxxx/T/#t
> ---
> include/net/mctp.h | 3 +++
> net/mctp/route.c | 8 ++++++--
> 2 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/include/net/mctp.h b/include/net/mctp.h
> index e1e0a69..d8bf907 100644
> --- a/include/net/mctp.h
> +++ b/include/net/mctp.h
> @@ -26,6 +26,9 @@ struct mctp_hdr {
> #define MCTP_VER_MIN 1
> #define MCTP_VER_MAX 1
>
> +/* Definitions for ver field */
> +#define MCTP_HDR_VER_MASK GENMASK(3, 0)
> +
> /* Definitions for flags_seq_tag field */
> #define MCTP_HDR_FLAG_SOM BIT(7)
> #define MCTP_HDR_FLAG_EOM BIT(6)
> diff --git a/net/mctp/route.c b/net/mctp/route.c
> index e69c6f7..62517c9 100644
> --- a/net/mctp/route.c
> +++ b/net/mctp/route.c
> @@ -439,6 +439,7 @@ static int mctp_dst_input(struct mctp_dst *dst, struct sk_buff *skb)
> struct mctp_hdr *mh;
> unsigned int netid;
> unsigned long f;
> + u8 ver;
> u8 tag, flags;
> int rc;

Please respect the reverse christmas tree order above.

/P