Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp825198lqs; Tue, 5 Mar 2024 19:18:41 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUncTsBbUGzMniRKSOdeKE9OcgdS9E4D4FrIg0uTq+MwvOFkZlzRHsKvKFvTE8p1gDy3kkSxmUvW1VgqwwLlrAZh/V9uxEqiGq87FJLnw== X-Google-Smtp-Source: AGHT+IGGk1VjOXbyXDuAzqe3jAIbjCIsB32eRmqcu0cyZY98PoYVxwMM8T/Rj1SVHyM0IPeuf9T4 X-Received: by 2002:a2e:a4c4:0:b0:2d2:39b2:90e2 with SMTP id p4-20020a2ea4c4000000b002d239b290e2mr2296414ljm.14.1709695121259; Tue, 05 Mar 2024 19:18:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709695121; cv=pass; d=google.com; s=arc-20160816; b=EsysQgsnOM9L7ZqIg2fuuUkDcgCgbwnjNoI3OPfU3gf0fkaDDrJhW9eCvjznPDxXAG VdgQcL2lOT68Gzkuqt9PwvLuW0Mn3FPCOVsEpa98SK+2EjI5BPQVkIw2cbZqd2OCcCpV D4JOND3wOCscGORHowGo2dG90PBYtwdVSY++d1ulnu9xYXxn3Ij7kEEwZE/L3h+jLT5g tC7mmOp3EtabTXRmWe/yN8CltpC54oPSmup+dyKXESVOvSsSqurqZAk721NL0o46OMvi 7fvPzZ/eE1x6KooSnEtBCjhC771+9TtLMqL8IT2ujPF1epAIZ3gaCJEuFOYekyQzAt4P skdQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=2ixqA4InFFlkIWCzZ5dIVXIZNVBRDZy4LIjW6eOj+Ko=; fh=IARVqdBFEYS161X9WnlR6z1UObJHwfzEaNw3nmiA9wk=; b=pTfssLdxJ7TJtDREAnlD9polyJ8E/kCRGwCGMSinunqoM1LOEuUGhcPKob5oVHBkX5 F4Fs9nOsB6pTQNUHcRXCRlFpZe3EmrTj5ENsNcyjX6hGrVPqNJqw1J69jXtiDlVQtXek iJJCEo68Pa4t9/ZAUHfHSPXvDs/0USfIc4it7LhtbpgBZt5/uX3v3YGutbjKQsVEjo8k 0BhJIZN/09v82u8PBKLNQoqyeKZI2LTiCvPG2ADRoCYz7uVdqGHobK7UML2aCc16L+Pp jP2YHqs5CvIH0hGM/Xx1NqDENVZADMHzB2XiAzMhSWI5R3XLOhvQoprSGPIMoDDgB/eQ nz3Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iyvlXl7V; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-93280-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93280-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id h13-20020a05640250cd00b00566a3aabb72si5740071edb.78.2024.03.05.19.18.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 19:18:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-93280-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iyvlXl7V; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-93280-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93280-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 0017F1F2516C for ; Wed, 6 Mar 2024 03:18:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5CAD7134B2; Wed, 6 Mar 2024 03:18:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="iyvlXl7V" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 8051E79E4; Wed, 6 Mar 2024 03:18:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709695111; cv=none; b=lUzmRDbl3LH9U0n5815rMCdHnabe+oj28RW6haax6ganAPw+YcKQZSJI4R6ZFHmetb9gDMGafqy+za9Rw9Vyxcs5k6ZC4LAtiuwvYLigdHfRzlqCwSJItHPHEsu7AjHMoUNDsqbca/Sr3xEYk2TNF8UEKyxHqm3gSud5aBIF02I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709695111; c=relaxed/simple; bh=mvhk95b95i5F452rphX9EHU3jHBno47T1oeALgtxQdg=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=C0Yd+ufNlRVFHI1m++Etsw47MgDXUJPg/dQ57xFBrPvSTXVPcUi37Ip+f9Rx/OW6JgC6JyF4ffNpPi4VLd0TNClcNBep75tuCWq+0sylMYvN5MNeiQbBDVboIpjFm6KvUYPX4F2a5LC9UGYgBi8Si+Sg7ObcdEQB9NT5Wj0h5wM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iyvlXl7V; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 79AEDC433C7; Wed, 6 Mar 2024 03:18:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709695110; bh=mvhk95b95i5F452rphX9EHU3jHBno47T1oeALgtxQdg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=iyvlXl7V8bapyhuZSoPvonj6gCY9sTdAKGZGJ2ioQyY9+vK/dpEszoUWAnd0s2s81 jxS97t9qkbNcogwcJNdhrtBnP0a82wcjj3yCsph6FNWN3bIRiEYfhPcGXQlPsei8q5 Uu7onBBx316wDONB2nRANFNwTea8UQSr0acVX51ioa4AzrYqxTsVOYw1s6oenN89Le E1JmBGnI8PQSXQloBdfXR4KTjzDJiRIGFszMCWfSVBKGHVQDUggtu3Fudj0A/+U1XC d6mUQyr7HYIX4RTpi/KWRb2ANWJVbFAuhKg6pgrGaqEchuIHhpTEInIzxmolnKmZyU cRlbdrY28jMjw== Date: Tue, 5 Mar 2024 19:18:29 -0800 From: Jakub Kicinski To: Juntong Deng Cc: davem@davemloft.net, dsahern@kernel.org, edumazet@google.com, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next] net: ipv4, ipv6: Fix incorrect skb->data_len caused by __ip_append_data Message-ID: <20240305191829.083ba9d8@kernel.org> In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 5 Mar 2024 22:42:05 +0000 Juntong Deng wrote: > When __ip_append_data allocate the first skb in the queue, or when the > size of the data in the skb exceed the MTU and require a new fragment > and allocate a new skb, both cause the size of the data increased by > this __ip_append_data to not be added to skb->data_len. > > This is because in the current __ip_append_data, skb_put is used when > putting in the data for the new skb, but skb_put only increase skb->len, > but not skb->data_len, resulting in skb->data_len missing this part of > the data size. > > All skb processed by __ip_append_data are unable to obtain the accurate > data size based on skb->data_len for the above reason. > > Also __ip6_append_data has the same problem. > > This patch fixes the bug. data_len is the amount of data in the non-linear parts of the skb. Please run some tests before submitting patches. -- pw-bot: cr pv-bot: s