From nobody Sat Feb 7 23:00:08 2026 Received: from out-183.mta0.migadu.com (out-183.mta0.migadu.com [91.218.175.183]) (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 66C801FBC94 for ; Thu, 9 Jan 2025 22:43:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.183 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736462593; cv=none; b=qwGaGmIY3MEZ2PcAOLV4fkml+iBoE9CKw8kGtJmOtNqrJUxRLV5OKbJ0TEJ/Hj9k7ThO6uWjK0vao+EX65vLq7buGQ6slBNFdKu9eMK/V0686mbIQ2YyRLfhcQ0HD0lAQcRiAyMn1ko8C9ELzKfg8C4scrVTx34p+n/8DPQ4psE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736462593; c=relaxed/simple; bh=Y972RU1/zU9CU5Otmw/OqyyjF0rGXGKhnzWYR1strco=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=NHgiNcbzFHikAKlNmhZBAbVXDUG5fX0R4TQGF0BnKgAzkWBYm1PAGAZMJjJVZj+Zzlo3XSsrYpEU5H7PRGXnktrY2ShGwypkbwDD5tj9D0tck96AYmdZB3klv1HqwrKNvZokax2FIlDVbxjh56NKyh3Gu7t4ywkGrHmDkfsXhl4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=gfOoS4A7; arc=none smtp.client-ip=91.218.175.183 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="gfOoS4A7" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1736462583; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=QE3eqh5wc4f4JZTZPBPucbaDDDy7F4dN4ZWKRzaggT4=; b=gfOoS4A7wzvo3W+np3l6aMRQHtNh5Qyc5XmtEm3DWQNGiA8PEESsn3lSjzA0L/+DRs/u2P ujmBWCqcrcilKzlq3bzzn7fOUEmtm7Gv7aigYGiuo4EsY8NZ+tfKuiTONTg5gvnxJX2vUl thYFdmU+HT/KWhKuwNTKnYYjROy50CU= From: Sean Anderson To: Radhey Shyam Pandey , Shannon Nelson , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: Michal Simek , Simon Horman , Daniel Borkmann , Andy Chiu , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Sean Anderson Subject: [PATCH net v3] net: xilinx: axienet: Fix IRQ coalescing packet count overflow Date: Thu, 9 Jan 2025 17:42:46 -0500 Message-Id: <20250109224246.1866690-1-sean.anderson@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" If coalece_count is greater than 255 it will not fit in the register and will overflow. This can be reproduced by running # ethtool -C ethX rx-frames 256 which will result in a timeout of 0us instead. Fix this by checking for invalid values and reporting an error. Signed-off-by: Sean Anderson Fixes: 8a3b7a252dca ("drivers/net/ethernet/xilinx: added Xilinx AXI Etherne= t driver") --- Changes in v3: - Validate and reject instead of silently clamping Changes in v2: - Use FIELD_MAX to extract the max value from the mask - Expand the commit message with an example on how to reproduce this issue drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/ne= t/ethernet/xilinx/xilinx_axienet_main.c index 0f4b02fe6f85..c2991aeccf2b 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c @@ -2056,6 +2056,12 @@ axienet_ethtools_set_coalesce(struct net_device *nde= v, return -EBUSY; } =20 + if (ecoalesce->rx_max_coalesced_frames > 255 || + ecoalesce->rx_max_coalesced_frames > 255) { + NL_SET_ERR_MSG(extack, "frames must be less than 256"); + return -EINVAL; + } + if (ecoalesce->rx_max_coalesced_frames) lp->coalesce_count_rx =3D ecoalesce->rx_max_coalesced_frames; if (ecoalesce->rx_coalesce_usecs) --=20 2.35.1.1320.gc452695387.dirty