From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796418575; b=Oe2OdL3tB0giGk0o18Piv2Hk6NGQ9lH6GV3O5du7XWPJqNEnUVcPvkQRnYaNXaXVe+AS s/72eefAbG6rqCZzFNXPcaqqukL2zuzQRwfxIzT1Oide09yAFV3VCnVQVVeBK69SOaBTc NqSqEuoAwUt5rDSOV28dUMVJSNev2HPRL8k2kv8hTVfdnao9F9yQO9s0Iqr+dPxgBIb/R rmooUBB7LzfE+ArSwqE2YsA3s82NzuPdYI1mr0PUjDRvPZPgZpXktsqVFIS7XMnhnf8OB MshwTJ3aJXWVhw0u+BqSWlMN2shdg21Z8kZT0Gl3Z4vjwXZqZUpyNKCglE55p/N2GEQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796418575; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=7QBjM+AHdPhSd07wZCbNn4V+gb1StVaF6pBdSI4sPQM=; b=5b2zFN0AuwO1c88nqqjpB3TN1G+YsmvSFvAVwcIqiNsmGZc3Lv7ICDVdLuuGmwBz685d 13z523/tIW8JgNlOE5jYPybNBl9w/6iicRFwImRUiD01Hu2lyb27tCZ6e4XLfrJehbHnb olKFHGqzsICTJnw95fBfY04DLX8L7pHenKz/0K/ZjWRsPy4KRLZ1szsGoFi8Wg4voaUXV D8cbUGVl9ogKQjK0Ds5xPGAVQDPV20l4re7iF1f637+MaXEcOFaqi7HU6B9e/1b6lKMh1 XtVsmThoIZpAKlAc97geskNPFtFiP0jG6tLAcbNGJABfODJfN9VefcLHbf2WJUvvUNg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=WYuXcqHk; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 84370606A338 for ; Fri, 4 Dec 2026 21:09:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=WYuXcqHk Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4E06A1F00A12; Fri, 4 Dec 2026 21:09:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796418575; bh=7QBjM+AHdPhSd07wZCbNn4V+gb1StVaF6pBdSI4sPQM=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=WYuXcqHkb7sKkiLctDIyPsDQCFpSI9xkK8bIke0gfBq1XgisU/P3hPYE/hSF0zdSy kknTtRAXlO+QXCfo1RsbJ6YTdbWVOxOyzXZ7P/Jt4VEhlwlEKVchilmuppv6x4HJaW DIkk22Q4dksW14wFWbjKvkBHwJqefpM8Nh5aNkXT7Xa3kRPqAG8YKoVzKhUPGuhfL5 96CwCE+v6OmqsDtWRdzkbe5X4Pc4gzNX5ol+AEx8s2mdQbEeZwz+2YohP+WJjUbcKV /Xf9D2KOIdTR0lRhvH6ig+1urTeENsOcyxR/8FhPTfM2d6ydiePqBYWEf0q8E1EAvB XbS/NrHpUtljg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH net 02/10] net: gro: reset unreadable and pp_recycle in napi_reuse_skb Reply-To: sashiko-reviews@lists.linux.dev To: "Octavian Purdila" Cc: bpf@vger.kernel.org In-Reply-To: <808e0a7c2cbb252654d1d55368858b774cf48853.1796329894.git.tavip@google.com> References: <808e0a7c2cbb252654d1d55368858b774cf48853.1796329894.git.tavip@google.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 21:09:34 +0000 X-Mailing-List: bpf@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] net: gro: napi_reuse_skb() clears pp_recycle on page_pool head_frag skb -- commit b36e9ed0c17bf92ac591da7f73dbb5d385defdc5 Author: Octavian Purdila net: gro: reset unreadable and pp_recycle in napi_reuse_skb This commit clears skb->unreadable and skb->pp_recycle in napi_reuse_skb() so stale state is not carried over when napi->skb is reused. > diff --git a/net/core/gro.c b/net/core/gro.c > index fb730017fd3ba..c1d07bca1b4eb 100644 > --- a/net/core/gro.c > +++ b/net/core/gro.c > @@ -697,6 +697,8 @@ static void napi_reuse_skb(struct napi_struct *napi, = struct sk_buff *skb) > =20 > skb->encapsulation =3D 0; > skb->ip_summed =3D CHECKSUM_NONE; > + skb->unreadable =3D 0; > + skb->pp_recycle =3D 0; [Severity: Medium] Can clearing skb->pp_recycle here break freeing skb->head when skb->head_fr= ag is set? On a TAP device with IFF_NAPI_FRAGS and a multi-buffer generic XDP program, tun_get_user() can store a system_page_pool-backed skb (head_frag =3D 1, pp_recycle =3D 1) from do_xdp_generic() -> skb_pp_cow_data() in tfile->napi.skb. If the XDP program trims linear data to the headers while leaving payload in frag[0], skb_gro_receive() merges the frag with NAPI_GRO_FREE and routes th= at skb to napi_reuse_skb(). When the cached skb is later freed, skb_free_head() skips skb_pp_recycle() and frees the page_pool page via skb_free_frag() -> page_frag_free(). With CONFIG_DEBUG_VM or init_on_alloc this triggers bad_page ("page_pool leak") and leaks the page; otherwise pages_state_hold_cnt is permanently imbalance= d. Should napi_reuse_skb() reject skb->head_frag alongside skb->pfmemalloc and pass such skbs to consume_skb()? --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/cover.1796329894.gi= t.tavip@google.com?part=3D2