From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) (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 B8494371885 for ; Mon, 6 Jul 2026 15:02:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783350140; cv=none; b=CP60R1pMTk/rs001Ec1R8pZcu21OG2B/d2PxvRERGr/n0sRCrfxhptLw1j9nL9OqJK8BDQ+exhJWAxIeEsL7ChO+wL6cIaeNl6av90QJpkT5jMTpxF4jJ7Y25Kp9LkOVrX4r7TSFcXOlLxPo1IQr9caatQGwtBNNWzvQQ47+nmA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783350140; c=relaxed/simple; bh=Tu1T8CD2gLrLisSnGvRjNH6xqg64dimtg4QpZpNNiRM=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=ebXKX/L06eT+aU0KLPy3xKZUhiMs5jXmMguAOgW7z88+h4A71QXmTAfdDbduhniz5I2XVUj+Bg96FKQ4/JAhZE1ndXmWkF1a3HYofHqvRaoUK0RLuQmOTzKbiZ/0GLLz6DtIEvitMgzhCg+qCfFrcYDCLSoNQlSbDEt1DJ23zM0= 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=pZe97Zap; arc=none smtp.client-ip=209.85.214.181 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="pZe97Zap" Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-2c7c61b5292so46168485ad.0 for ; Mon, 06 Jul 2026 08:02:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783350138; x=1783954938; 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:content-type; bh=LB5HPrejrIhgE2QNFJCFw/424JZb2O52qaJtg8sw1Ew=; b=pZe97Zapn0EDrxm/vTHJXREd4FGa+k1xib76tr0CVkYrdy/t4dfFZ0XN17YgVOPF0l eI3cwqDHV8ILRCfycZamEjiPAAW4UjxB4F85ARAfwzwTkPCQew207LKkjNeD4PzHzUP+ BY0z8RsD+dqNwGrvhpRTGEgNUmnpU8AwtDatPXBSGxyg+OhU37Y4gXCZokb0MOMWQals kILtPwZM/44w85L9Kx40kjHEGaGiZQJUEGtVZLyBrpdu44J+jRjZa10RLxMgRkUwG7jk b8NP/Ilzjf7lOK3qO21q7ukS+ZEb7374q5m1pXhkshrtIBYeFfkfiP9SbZGNLWggFA1D 34Eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783350138; x=1783954938; 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:content-type; bh=LB5HPrejrIhgE2QNFJCFw/424JZb2O52qaJtg8sw1Ew=; b=g3Jsm6ug8rCGK6tSPuO4letMIMn5n8YgoiUiyN9QHdS6riplFLVwG3LDm+Tpjro4vy y1Q3G1FLnNcH7x1qwOsRtfA61eE48xLl7UoDKOQCcjxJv69RFvIG3n1YGn8RiLtQFEHV 61EJJglPOY2XOtJ80iliUn4Y+7/1ydQ2K6QIFtprQ6ZjyNhrR/c8VPBHgOVTAMxYFZth b9DPOw9NA7lV+oW7/WsCjbAWROs4MzmxWFI3bT/ePArlUR0p4uGRoHTDSzoW8d+ON5O2 crc3/iRypgz6B2aEI9m0lM2RLOesCF8VrfPQtkg34i1HfLDpFlAkpfM565qZd4R7SZzx 8Csw== X-Forwarded-Encrypted: i=1; AHgh+RotKZF3HhhWXLZzX354Zl6NdRMc/2OH3wo2aETnthzuKUHL98EQ90ojPTs1mj9SVC+7nbOORRyGD+BkNPo=@vger.kernel.org X-Gm-Message-State: AOJu0Yx8HgZ8Rfjaj03JFFFLianGlPkpFtyTDRvQWCZXffBNWxzgaKiY t/ifReXe3fAkEa5Pr3qgQppTngPdt0Ewni77vwH5WosE/HujeicwJsqx X-Gm-Gg: AfdE7clrq4Wy1We5hmEj+l65ngWkeUA1pluK8/KN7a+Abal2vTag0Toffdyk/alpM3w OyXPANqyvkR/NQk1lSgrBDEEqxecyL1HNmW5lWbr2Uh7BuqImp3pDqN8UfygFa3Y7hxeRGRgKpn l+Qi7gkyJFZ1KuTxj2yhOJK9wGFOWT040+e2qBfkLM1NOfI9Lk18PXM25hl65+KtgD4trZ54DZ0 7yH3E7Ear5lkGlwzerexGv3BgNwfo1uPci5l2hw7wVx3Z9jsAEfGRpvt0n90d07Krm5BfE1xTSI M4POLNgPVf+MJCFRSeChQyB3D/lFR0QI9glcyM/ZOdfjnzjnR2DlDS+mIAM0wpfsO/ApGkqJVRR U8NswTHIRiFsmWT1ANdISMLDDB7G3xbDIyHaEb0CgyyiXOMTgmUw6Xh3vBmW4ziw1XkTRLyRmcT W0Bh9g0TDHSYsW4Ib2j6HjqyXwnfqtAC1Viy9UdA== X-Received: by 2002:a17:902:cec2:b0:2c9:c46b:1286 with SMTP id d9443c01a7336-2ccbf07a0ebmr9811045ad.34.1783350137600; Mon, 06 Jul 2026 08:02:17 -0700 (PDT) Received: from csl-conti-dell7858.ntu.edu.sg ([155.69.195.57]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2cb3f5b7090sm41651765ad.26.2026.07.06.08.02.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jul 2026 08:02:16 -0700 (PDT) From: Maoyi Xie To: Veerasenareddy Burru , Sathesh Edara , Satananda Burla , Shinas Rasheed Cc: Andrew Lunn , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maciej Fijalkowski , Guangshuo Li , David Carlier , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net v4 0/3] octeon_ep, octeon_ep_vf: fix RX skb frags overflow and page leak Date: Mon, 6 Jul 2026 23:02:05 +0800 Message-Id: <20260706150208.2944898-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 The octeon_ep and octeon_ep_vf RX paths add one skb fragment per buffer with no bound against MAX_SKB_FRAGS. buff_info->len comes from the device response header. A long packet needs about 18 fragments. That is one past the default MAX_SKB_FRAGS of 17, so skb_add_rx_frag() writes past shinfo->frags[]. Patch 1 bounds octeon_ep. Patch 3 bounds octeon_ep_vf. Patch 2 is Guangshuo Li's fix for an octeon_ep_vf RX page leak on the napi_build_skb() failure path. It touches the same drop code as patch 3. I carry it here so the series applies without conflict, per Maciej. Patch 3 moves that drain loop into a helper. The helper carries the page frees from patch 2, so the overflow drop path frees its pages too. octeon_ep has the same leak on its drop path. A separate patch will fix it once this series lands. v4: - add Guangshuo Li's octeon_ep_vf page leak fix as patch 2, per Maciej. - octeon_ep_vf: the fragment count fix now sits on top of patch 2. The drop helper octep_vf_oq_drop_rx() frees the head and fragment pages. - octeon_ep: no change, keeps Maciej's Reviewed-by. v1: https://lore.kernel.org/r/20260701112825.1653044-1-maoyixie.tju@gmail.com v2: https://lore.kernel.org/r/20260702180518.2013324-1-maoyixie.tju@gmail.com v3: https://lore.kernel.org/r/20260704061511.2350737-1-maoyixie.tju@gmail.com Guangshuo Li (1): octeon_ep_vf: Fix RX page leak on napi_build_skb() failure 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 | 49 +++++++++++++------ 2 files changed, 42 insertions(+), 16 deletions(-) -- 2.34.1