From: Simon Horman <horms@kernel.org>
To: Yizhou Zhao <zhaoyz24@mails.tsinghua.edu.cn>
Cc: netdev@vger.kernel.org, "David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
linux-kernel@vger.kernel.org,
Yuxiang Yang <yangyx22@mails.tsinghua.edu.cn>,
Ao Wang <wangao@seu.edu.cn>, Xuewei Feng <fengxw06@126.com>,
Qi Li <qli01@tsinghua.edu.cn>, Ke Xu <xuke@tsinghua.edu.cn>
Subject: Re: [PATCH net] net: garp: fix unsigned integer underflow in garp_pdu_parse_attr
Date: Tue, 2 Jun 2026 17:17:59 +0100 [thread overview]
Message-ID: <20260602161759.GC3410996@horms.kernel.org> (raw)
In-Reply-To: <20260527083200.42861-1-zhaoyz24@mails.tsinghua.edu.cn>
On Wed, May 27, 2026 at 04:31:58PM +0800, Yizhou Zhao wrote:
> The receive-side GARP attribute parser computes dlen with reversed
> operands:
>
> dlen = sizeof(*ga) - ga->len;
>
> ga->len is the on-wire attribute length and includes the GARP attribute
> header. For normal attributes with data, ga->len is larger than
> sizeof(*ga), so the subtraction underflows in unsigned arithmetic.
>
> The resulting value is later passed to garp_attr_lookup(), whose length
> argument is u8. After truncation, the parsed data length usually no
> longer matches the length stored for locally registered attributes, so
> received Join/Leave events are ignored. This breaks the GARP receive path
> for common attributes, such as GVRP VLAN registration attributes.
>
> Compute the data length as the attribute length minus the header length.
>
> Fixes: eca9ebac651f ("net: Add GARP applicant-only participant")
> Reported-by: Yizhou Zhao <zhaoyz24@mails.tsinghua.edu.cn>
> Reported-by: Yuxiang Yang <yangyx22@mails.tsinghua.edu.cn>
> Reported-by: Ao Wang <wangao@seu.edu.cn>
> Reported-by: Xuewei Feng <fengxw06@126.com>
> Reported-by: Qi Li <qli01@tsinghua.edu.cn>
> Reported-by: Ke Xu <xuke@tsinghua.edu.cn>
> Assisted-by: GLM:GLM-5.1
> Signed-off-by: Yizhou Zhao <zhaoyz24@mails.tsinghua.edu.cn>
Reviewed-by: Simon Horman <horms@kernel.org>
FTR, there is an AI generated review of this patch available on sashiko.dev.
I suggest that the issues raised there can be looked at in the context
of possible follow-up rather than something that blocks progress of this
patch.
next prev parent reply other threads:[~2026-06-02 16:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-27 8:31 [PATCH net] net: garp: fix unsigned integer underflow in garp_pdu_parse_attr Yizhou Zhao
2026-06-02 16:17 ` Simon Horman [this message]
2026-06-02 19:20 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260602161759.GC3410996@horms.kernel.org \
--to=horms@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=fengxw06@126.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=qli01@tsinghua.edu.cn \
--cc=wangao@seu.edu.cn \
--cc=xuke@tsinghua.edu.cn \
--cc=yangyx22@mails.tsinghua.edu.cn \
--cc=zhaoyz24@mails.tsinghua.edu.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox