From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4011B3033DE; Tue, 2 Jun 2026 16:18:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780417085; cv=none; b=Hm7PjUMKAluB7RJV9xNHA0UetrHQE4sZDIZU4OGHxh2nlrTHFs3sLNPgAT+rA+9FNl4OIDO2CVhwV5IB0+GyVCw/PeXelBG3W1snbmGcV1cGmlMuhgyhBIbsSeXr014K0wPd0AyhB9/e/YWKAMdhDhnnR2B34SQr77wqfXC20Fg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780417085; c=relaxed/simple; bh=Rvh/QCRNWypoeRbVX5OlUJF4PsltkF0tUyYMioI9AZU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=AFfus0VnRhsu8e+MxWpULk6VyL1+6yTsUv1kvzADaP+LfObSjw1aF6jAvcLFE+ptFEdTzC8W6VKhiN45MeOL6Itnhwf/iVaPOI6yaQ9l2At9d1Nx9BdliNGtRyqLG/sx3sff9ZgGRegJYUTSRn5VycSttEJLUomEXjnG5w2/04E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LVhb4v6U; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="LVhb4v6U" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9AB261F00893; Tue, 2 Jun 2026 16:18:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1780417083; bh=12QO2v/oPPaXo6bAnv+kg5Ii4FyiJqb2Htu66F1W9ck=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=LVhb4v6UKrFpmmn96bo2JUHMJaUaK7uqzcT2HE1Oowedc9kLG7NUAJkT872HQ9nTn /qk+9VO8pHSFE0MlmTWA7XMOtrSABlo3htmuV/Tm9GerxpzHv/eulIIBApMKP6uyck yk9kWskGXnz0UrDU7E/WqXSGwgHHBhYCp94cpN5RFRR4pCUvExwtwzStE3n+IFwwZo zDPP+KxEZQTQJnGIZn5mjkwnBLCDb2LF2YkxJtEOunUK8D1tb7SfsnRF2LrChnqP/m 5pLSRkwMoXZi+klnE6WLIXLiwd2HMgok8BgMeA056SNSn1Wpx0NmgX6q2ujsph6apq vu7vNyZbgQ8Qw== Date: Tue, 2 Jun 2026 17:17:59 +0100 From: Simon Horman To: Yizhou Zhao Cc: netdev@vger.kernel.org, "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-kernel@vger.kernel.org, Yuxiang Yang , Ao Wang , Xuewei Feng , Qi Li , Ke Xu Subject: Re: [PATCH net] net: garp: fix unsigned integer underflow in garp_pdu_parse_attr Message-ID: <20260602161759.GC3410996@horms.kernel.org> References: <20260527083200.42861-1-zhaoyz24@mails.tsinghua.edu.cn> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 > Reported-by: Yuxiang Yang > Reported-by: Ao Wang > Reported-by: Xuewei Feng > Reported-by: Qi Li > Reported-by: Ke Xu > Assisted-by: GLM:GLM-5.1 > Signed-off-by: Yizhou Zhao Reviewed-by: Simon Horman 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.