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 4078336A36C; Tue, 16 Jun 2026 18:18:22 +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=1781633903; cv=none; b=MO4Voh5mNucYnntiR+l3OzwFh8MxTGYuN3eZQdzqk2hgMN9kjr2WwRuApk5qe0Kd2N0nAxgFSfh4950HhtZBHuEu6U1fCivUIgVyRr9QT7x/R5CKXxVZqkYAUAqGg4EM7RhvEUecVpA4qTvKXDlaA14gMCpaRwHGYFHD9h9+EXA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781633903; c=relaxed/simple; bh=KpwdCiSTSDJszqEtYwA7AifqZWknqZtLo76yDjv2HKg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SA0VWtkvJM+9KE9HMSC0/CZBQaI+Qw2GIg3TKT0QKE6QwSMHs9M8n1qYu+1ql8WYiucCy1/vIcI9pQv7Q7nYVHhxdRdy9v2qx6RModhEp+BzOfPOXBgLow19PQIvCvoFjD7wr8dSzcQzwFoiYdwuvD03736l16D5pQ1Tn+NnaXs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=uOtkbann; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="uOtkbann" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2CC371F000E9; Tue, 16 Jun 2026 18:18:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1781633902; bh=EP6IGHjMevZPdW/Q3FSu1+avuxi5Gx95G9thzeUZ5Hs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=uOtkbannrwmtP4/vtFa+yAi2HgaymMTJLuNyvjt/PZrVte6o8qgJ2fpyLl+6UmDoV MbCKcLwIYeCTWlyAZCEP1PLL99Q76deF6iGdac2kHhKmtd0ORq5vSOLPugNJOC4X5x YPJkaAZys7XCBxQWGDrwDlMMsMjzQ088Ue8nt6GE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Yizhou Zhao , Yuxiang Yang , Ao Wang , Xuewei Feng , Qi Li , Ke Xu , Simon Horman , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.15 160/411] net: garp: fix unsigned integer underflow in garp_pdu_parse_attr Date: Tue, 16 Jun 2026 20:26:38 +0530 Message-ID: <20260616145109.002081675@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260616145100.376842714@linuxfoundation.org> References: <20260616145100.376842714@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Yizhou Zhao [ Upstream commit 16e408e607a94b646fb14a2a98422c6877ae4b3c ] 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 Signed-off-by: Yizhou Zhao Reviewed-by: Simon Horman Link: https://patch.msgid.link/20260527083200.42861-1-zhaoyz24@mails.tsinghua.edu.cn Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- net/802/garp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/802/garp.c b/net/802/garp.c index f6012f8e59f005..2c456b362621e6 100644 --- a/net/802/garp.c +++ b/net/802/garp.c @@ -452,7 +452,7 @@ static int garp_pdu_parse_attr(struct garp_applicant *app, struct sk_buff *skb, if (!pskb_may_pull(skb, ga->len)) return -1; skb_pull(skb, ga->len); - dlen = sizeof(*ga) - ga->len; + dlen = ga->len - sizeof(*ga); if (attrtype > app->app->maxattr) return 0; -- 2.53.0