From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com [209.85.208.180]) (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 E1E8A3CF204 for ; Thu, 16 Jul 2026 09:02:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784192564; cv=none; b=kS+xdwhKK59blAu1frs46O4zXB35vhr7jk+YlbuZqrMkU6ZVjA65ivu4/rS15m4A/ht9t9aYIp0gUYXOP63pF3IRn8nXVAUFTF/FOkNywj68X3RK8v09E74SN3H3wXNGOdg+VHDjbXX0ydZ2MfeTc7kvwsjEZG0ysOEH5jRGFzk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784192564; c=relaxed/simple; bh=qArU7jGvFOZuD/4gdttHvUBeXvJ2+m/yQhcjCEo7q6U=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=jyWNyineRvPLG9WsecXz2QH6htrhCAOHyNVdXHvEdV41CUho3IyeshzareDG9MqDzRPUVe72qxkw6pGL44IOtMY3p78SLD05RXWzxDM7I9h4dGxt/CEGQM5j9VvnJK/s8D31aL7Y7OrhpVFf/JwkzoVuzrs6NMZj4jl/uXqNql0= 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=GCgdSxD4; arc=none smtp.client-ip=209.85.208.180 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="GCgdSxD4" Received: by mail-lj1-f180.google.com with SMTP id 38308e7fff4ca-39db07589caso23212731fa.2 for ; Thu, 16 Jul 2026 02:02:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784192558; x=1784797358; 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=kn7GeBfx/Msft0TxexvhlKJDP63ENruWeUlNuJK7TPE=; b=GCgdSxD4Ye1wQdVXR0qjJTyhGmbKcFhkB9MXXawuRaIClmzQL+rqHb8htKIk4BDIR9 74lD/frL585vQN4JjGmzls9hfCzPBXqUIYqj7hhWM9wSRanY5Wh9tERrDxOa6y34oOrb J1IzJggI+B6y1zE4XHlnmpvFTWIR+ERIW8t7lIORg31SxZsbL41V92sOnmgp46292lhA /66rSnmKQlz5qMZABpekG9S0vi6FxcgMO2dOhFoJyL1ZcedEOsouRltDPA8DyF5Wtofo T95Za7qDhof/Vw6zJfJuGXT1LOiPyZWjJhhsoYAMEWoSshuT+ULrk4WXJ3RCShxJNbNK ZN1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784192558; x=1784797358; 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=kn7GeBfx/Msft0TxexvhlKJDP63ENruWeUlNuJK7TPE=; b=dha81osIAVwPl9iyB0fyvuIwSqeZlC6OaCZLq6avMK/7gwSEsBBVwEe7a3xmKVng4w ctBd+CYHpH8YNvW420LKSu6KrMV5ZYHTa0UGWkVK5RL0cYehz8eA/XCyxlT6u+uIBrJk uZXHUi/PrXWzc+nQDG/MJ6QajL6Y5AfZYd5KBRMOpm2XHKtb2Ff0JNIXH+NoFqtv0b1u VhAMj+9iXxaUloLrTW2/MqOQ9ZTujw3HBCPKbf2iV3Z8MGeYUjsMYDJ6Pis03QBb+g7a 5GA0iDTBDLVRHAJiZPaafnJzz9CJ+jOpR2kmkwZ3dIfh6pJU4Genx4+6baLug8KMnpZY Aa1g== X-Forwarded-Encrypted: i=1; AHgh+RoMMkshfpSrlHaPYqemA4oPuTI8Juqtr0Uy1EDI/HrP//ezwEDWHAki4mKshgVPwEIr6bMXPxO+67QurkA=@vger.kernel.org X-Gm-Message-State: AOJu0Yw3o4uwqiNZNkEeOVCtnZCIbkWoK4VwrBzlNGE36pNw+IjTRBsl 9Xg+7k1OI0woU+Fv1vHWtNlvI5V/aOS6oZa1vs8BI17/hW+iCFJjDQb3 X-Gm-Gg: AfdE7cmwzVlDMDWB+e/alImpz27o/XlzBqsJproJmpU6OJy5PVHXyINO8BUGE5RZB5Z gF+oYtF/UX+/hkKLKUiczPB3JwgnTjdH0PTsckuH2OqcT0pWGSRpRPqKm7mxfQjSEXxvLzatpCf uRD/QbSFiI3rV5yWv1j2qisRSg5aFrz6ijYVc707duVf/3NebqMdq8J6N323HF19cE0zR56g8IR in/ykcrnH9HInvMALLgD7F4pWFdIOOP/4fGChwDU6XW3D0UJfAakfOdeaFcX1kqOmMkQt5jQCG1 E+a565oL3R9Iz0C8Pi/nzFyn3DRegZNJNbh3Rr74niqsb6Z00KfoPrhCZJprXFaFRQB+MsQXZYd 5kRkj+31NcOxk1doyOMD7SxO1s7uoRn087zj0qEGvBTnbSrZ899qkcUWjZ90sKsS6mDFase0W98 CKr72OQGhD X-Received: by 2002:a05:651c:50d:b0:39c:9dbf:f7b3 with SMTP id 38308e7fff4ca-39db69fa9cfmr13309161fa.0.1784192556314; Thu, 16 Jul 2026 02:02:36 -0700 (PDT) Received: from grower.astralinux.ru ([81.9.21.4]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-39c84b1c943sm41222011fa.18.2026.07.16.02.02.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2026 02:02:34 -0700 (PDT) From: Alexander Martyniuk To: stable@vger.kernel.org, Greg Kroah-Hartman Cc: Alexander Martyniuk , "David S. Miller" , Hideaki YOSHIFUJI , David Ahern , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Pavel Begunkov , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org, Jungwoo Lee , Wongi Lee , Ido Schimmel Subject: [PATCH 6.1] ipv4: account for fraggap on the paged allocation path Date: Thu, 16 Jul 2026 12:01:45 +0300 Message-ID: <20260716090147.17201-1-alexevgmart@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Wongi Lee commit eca856950f7cb1a221e02b99d758409f2c5cec42 upstream. In __ip_append_data(), when the paged-allocation branch is taken, alloclen and pagedlen are computed as alloclen = fragheaderlen + transhdrlen; pagedlen = datalen - transhdrlen; datalen already includes fraggap, but the fraggap bytes carried over from the previous skb are copied into the new skb's linear area at offset transhdrlen by the subsequent skb_copy_and_csum_bits(). The linear area is therefore undersized by fraggap bytes while pagedlen is overstated by the same amount. The non-paged branch sets alloclen to fraglen, which already accounts for fraggap because datalen does. Bring the paged branch in line by adding fraggap to alloclen and subtracting it from pagedlen. After this adjustment, copy no longer collapses to -fraggap on the paged path, so remove the stale comment describing that old arithmetic. Fixes: 8eb77cc73977 ("ipv4: avoid partial copy for zc") Signed-off-by: Jungwoo Lee Signed-off-by: Wongi Lee Reviewed-by: Ido Schimmel Link: https://patch.msgid.link/ajFR1eLAIs42TN3g@DESKTOP-19IMU7U.localdomain Signed-off-by: Jakub Kicinski Signed-off-by: Alexander Martyniuk --- net/ipv4/ip_output.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index f5a2ad2b2dbd..778214137e4a 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c @@ -1117,8 +1117,8 @@ static int __ip_append_data(struct sock *sk, !(rt->dst.dev->features & NETIF_F_SG))) alloclen = fraglen; else { - alloclen = fragheaderlen + transhdrlen; - pagedlen = datalen - transhdrlen; + alloclen = fragheaderlen + transhdrlen + fraggap; + pagedlen = datalen - transhdrlen - fraggap; } alloclen += alloc_extra; -- 2.43.0