From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3249635E1B5 for ; Thu, 2 Jul 2026 18:05:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783015527; cv=none; b=gIcjdwlPmBNJv7NFoBPcoRWAl+ByCxYV1uAxHZ/qZ9t62zhJCr4KajI+hGEnPIJxtk9LiVQXhAXbrdp6YpdpJ1biWf+Ihfop+LxLBOz6p6uRb24RjExYspMK/TFyHR6ijhSg0CsbwLE9KW21ITstqVj8e3HmAv/+pRvnGe4hPog= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783015527; c=relaxed/simple; bh=eXe6gHrIdzx3AbyH6byQKRn33eQMYZps1YSv6k53jyI=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=MZ9BWtj+9+Br1aSM7krwqZvxkrU6v4O6z42u1G/IU2JK658s+aw8WXceDfCgPZZB1To7nE/nDLO75w3s0hMm7oEwzv6TduW1J9fn7dLrrjro+6+wWRrkXr8se41wSUM4qMUgiQvqL1eFVhz+qiQgZQTl6q1K99Zqp7Xb1C/p01Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=aZnIiu6C; arc=none smtp.client-ip=209.85.210.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="aZnIiu6C" Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-845ea8924fdso1877578b3a.0 for ; Thu, 02 Jul 2026 11:05:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783015524; x=1783620324; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ngrWeAFGWZKAuNlc7TaCDTTI9bO1M1TDbhwW7lrz4r4=; b=aZnIiu6CNcmCglYWhOCt2CMKuCKNv+GjcbVlbFL9L0Yb1V251gxgpYfRcBxtf7f/32 MEC1oQjd3ZyGIyPMGYYzkYLB6BqdLGHXbCA3c5fCLdvQDK0lFfoPZIdX/xElxqGe1GBA yBeJ0MneHgFHU3RiQqh1+AJSB8AWO6sBOZ5VhsEW44yAEGyTpj9u5agEe59AAXcg/hV0 GHXQC1CY0BSpFlxrdJzkAVughLy/PG6sw4DRep37QOSax5qy/pdbQxacdGAPl3u/Ezgw +2xKQeLercrDW+tMvORwRD7/e8y1Fhg5ad+bBwxyMf811oTC2nLbK2G8dEwbND9llT98 WPgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783015524; x=1783620324; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ngrWeAFGWZKAuNlc7TaCDTTI9bO1M1TDbhwW7lrz4r4=; b=kfISojbYbuhVpak+7C5vwzaLrnPn6rIbjyDK9djrJT2eCES0kfv6kGZQh1ASq4Z+ul rNIExhcuXe5vsbh8Ic5iWIeAwCDskRFYnY8cpQg8eRDq1/NBByWWrpRY9DP97giGEz/9 ZBpzGsFnwjMsxpBlLE23N4t1ir2CpF5dvuCH1mPbnS+lML1PPYOdwqfAGM/7EHY3C4oP bdOGL7mNsVS1w3nvpD2InZcDQKfdDlU8e9lR4T21Jyr/g9almZ79qxlGzBB/t2QwxRjQ fh/q+FzsoNzTwdkFYBom0ov0UxQuz1CsYQUWETtJ4tCGnnI3lDX/knm92gtxXE1vh3DA 1zvA== X-Forwarded-Encrypted: i=1; AFNElJ+FelfGoz5zb/HSAAbEyZsu5WB8tn56B6dW2oGHPgi1e8g1PhKAkkKv5hNNM428zZyZKMYHgvEQ6yjtpw4=@vger.kernel.org X-Gm-Message-State: AOJu0YwisDrWFpshewdqcXbpzt/iyLndjC1Ewad6mtzANHNDPBSVbNZU E1Wx88mFqJqmywtXawCAQdS3zUlH0dH0Owyt3yVt3MAc0dAZKKioBtladyX64Q== X-Gm-Gg: AfdE7cmTsJmbsBrn3vjkz1f41XJL8PtaxjMhkv3cSR6ANosbobZrm+VZ0UKS+dPj297 sN6PLxnSSX3pXPje6fyVLvUs/z7H1skk713DGmO6gCScwqoxc5Op9hv+oLEK6uHiA5+Ysf4KqC4 mtCGtZFT/LokRNzQvW/PkiqmECw733k7Z/4zp0cy5mVz9bEhPYjYDRu3Q6BNVW6WxGlEvdlRoqJ MiWKnox0cWXf5kES0gC78Mh5pTJ7fk8R7VJlenNPxuxGFkWRobdFd/X3HVmVBwdXQ+PcqFu0gCt rPFG3Le0Ll9haUEBrP5Q29Sp0aNlaJWBBHv64ehFHQg8QNxgs1pkPROwwMJnFo67HkBpxfnceEr IRdJai/FktGiHFKfJmvfTXWGuRHoakaJ8n3vB9NRZsfAveI+GnCBU88w6dZv6WluQYPLi36s/ZD q9Ta80Tazb5ohc4pCbdShMv9zfKppS5djVNqamdVLfbP//ez4l X-Received: by 2002:a05:6a00:cc9:b0:845:e23f:108 with SMTP id d2e1a72fcca58-847c088ec3fmr6916190b3a.42.1783015524252; Thu, 02 Jul 2026 11:05:24 -0700 (PDT) Received: from csl-conti-dell7858.ntu.edu.sg ([155.69.195.57]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-847cb78d69csm1701877b3a.25.2026.07.02.11.05.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jul 2026 11:05:23 -0700 (PDT) From: Maoyi Xie To: Veerasenareddy Burru , Sathesh Edara Cc: Andrew Lunn , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maciej Fijalkowski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net v2 0/2] octeon_ep, octeon_ep_vf: fix skb frags overflow in the RX path Date: Fri, 3 Jul 2026 02:05:16 +0800 Message-Id: <20260702180518.2013324-1-maoyixie.tju@gmail.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Both octeon_ep and octeon_ep_vf build an skb for a multi-buffer RX packet by adding one fragment per buffer_size chunk of a device-reported length. Neither bounds the count against MAX_SKB_FRAGS. A long packet yields about 18 fragments, one past the default MAX_SKB_FRAGS of 17, so skb_add_rx_frag() writes past shinfo->frags[]. Each driver now checks the fragment count before it builds the skb and drops a packet that would not fit. v2: - move the check before (napi_)build_skb() so the driver does not build an skb only to free it, per Maciej Fijalkowski. - the frag count check uses the same u16 length the fragment loop uses. The repeated linear/non-linear code in octeon_ep_vf that Maciej noted is a separate cleanup, left for net-next to keep this fix minimal. v1: https://lore.kernel.org/r/20260701112825.1653044-1-maoyixie.tju@gmail.com Maoyi Xie (2): octeon_ep: fix skb frags overflow in the RX path octeon_ep_vf: fix skb frags overflow in the RX path .../net/ethernet/marvell/octeon_ep/octep_rx.c | 9 +++++++++ .../marvell/octeon_ep_vf/octep_vf_rx.c | 20 +++++++++++++++++++ 2 files changed, 29 insertions(+) -- 2.34.1