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 A909E1E98EF; Sun, 7 Jun 2026 10:43:17 +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=1780828998; cv=none; b=VLV6clWzfiB06gtKWPwJ4UTHU5xGrhcDvBpGNEaQWx9Xr6tihHtEym7R1fq5kdqGObxM5GC4JRdG90A/hbudBkamXD04TWWRG+82xgrItYgtMQ74OH8Z99yRfobRLQZgJy07roA1ZqvbW+0hdQwRvMTFHyQqXRieksmJSc453aA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780828998; c=relaxed/simple; bh=7aakXSrGvC4DQNFZ6RYQZRhO5ly+kkqs/TxhCXLtSjk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sHYhd8N0XRN1iwC8+iE88/fk9sXGlM8axENigVKGvx4UQPKjdGOjV8eICyreUJsoOvwjcaIPFlWk6wXwFHM8YJkaER7MKFwRYFSJ+1aWA+4YOwm79Z6+IoaId1hyYUPubIdyrAg9khzwi7oUC8DuOx/8HOYio4kuitXNvmpNeHk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=hmVBYYQ9; 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="hmVBYYQ9" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EA6931F00893; Sun, 7 Jun 2026 10:43:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780828997; bh=wB3d7aj60x//mOtRARLB9QKqlr0UWggiLi+HRqWkmCw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=hmVBYYQ9kTJqVrj1wpKIhKX8IoAZxrqR3F4Bzco3cAwVHCETLWkV7Py9kJrzYklMx EL+Q6Bf+iano0JfJxjeBKs2QxRfs7pnwdEnvvDo65829NRO6sE4cu/QU9petJFrhJJ +X7d1q8KBmlf1+FDX++/yLLEWIOw4RCc/XGG7Gio= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Lin Ma , Chenyuan Mi , Jingguo Tan , Sabrina Dubroca , Steffen Klassert Subject: [PATCH 6.18 208/315] xfrm: esp: restore combined single-frag length gate Date: Sun, 7 Jun 2026 11:59:55 +0200 Message-ID: <20260607095735.194523853@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260607095727.528828913@linuxfoundation.org> References: <20260607095727.528828913@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 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jingguo Tan commit dfa0d7b0ff1eb6b2c416b8fdb9b4f2cefba57a40 upstream. The ESP out-of-place fast path appends the trailer in esp_output_head() before esp_output_tail() allocates the destination page frag. The head-side gate currently checks skb->data_len and tailen separately, but the tail code allocates a single destination frag from the combined post-trailer skb->data_len. Reject the page-frag fast path when the combined aligned length exceeds a page. Otherwise skb_page_frag_refill() may fall back to a single page while the destination sg still spans the combined skb->data_len. Restore this combined-length page gate for both IPv4 and IPv6. Fixes: 5bd8baab087d ("esp: limit skb_page_frag_refill use to a single page") Cc: stable@vger.kernel.org Signed-off-by: Lin Ma Signed-off-by: Chenyuan Mi Signed-off-by: Jingguo Tan Reviewed-by: Sabrina Dubroca Signed-off-by: Steffen Klassert Signed-off-by: Greg Kroah-Hartman --- net/ipv4/esp4.c | 4 ++-- net/ipv6/esp6.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) --- a/net/ipv4/esp4.c +++ b/net/ipv4/esp4.c @@ -419,8 +419,8 @@ int esp_output_head(struct xfrm_state *x return err; } - if (ALIGN(tailen, L1_CACHE_BYTES) > PAGE_SIZE || - ALIGN(skb->data_len, L1_CACHE_BYTES) > PAGE_SIZE) + if (ALIGN(skb->data_len + tailen, L1_CACHE_BYTES) > + PAGE_SIZE) goto cow; if (!skb_cloned(skb)) { --- a/net/ipv6/esp6.c +++ b/net/ipv6/esp6.c @@ -448,8 +448,8 @@ int esp6_output_head(struct xfrm_state * return err; } - if (ALIGN(tailen, L1_CACHE_BYTES) > PAGE_SIZE || - ALIGN(skb->data_len, L1_CACHE_BYTES) > PAGE_SIZE) + if (ALIGN(skb->data_len + tailen, L1_CACHE_BYTES) > + PAGE_SIZE) goto cow; if (!skb_cloned(skb)) {