Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3716512pxb; Mon, 1 Feb 2021 02:51:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJyatV37PUz2h9C/KDwn4VpRej7YAcZyY6wzenuA4Ouf+LYzI3p2y9PFtbBSj++Hv/hm3Dp6 X-Received: by 2002:a17:906:c049:: with SMTP id bm9mr16493044ejb.535.1612176671260; Mon, 01 Feb 2021 02:51:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612176671; cv=none; d=google.com; s=arc-20160816; b=nbMLFJQWPHMAzSpzIlagrx/8EaZaerGrrl097MnjXNLHQbQwA1k1rV4zudCUsIVFVs /P+jzM38hAnA0o7ZydSEPgB8N2HW0KcW/N+wE3ZPg1i+nDqbDwlu4ijPLYvSfBdfjL3j Y8xQxBaq48gqZXm38mJ/VvyYSOXkUcBeHi633ymLV7CFmAPsoqi/0/JMwtAFcLdUBjQg sk31FYcFwu2xzz1hKvTi1WzMi6DfxXGvkF+vchmqU8vg5AYoyhoyel0r3OM43TLlGVC5 NSQoOSFFVuzSM6x+Ib7p01LVDS546Vd0ZFEk4AkXKMChsn0L2DFuBZ8ktr2XIiMrQAn5 pn+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=3ahVfaMAWzVEmDVakumdMajUgJJioFFzCyRQz4vDITs=; b=nnSoMo9iX9PhvGEBm042h1sky1ycAol3GpQ6cGn9ItuDNc/qVspYGC4cce+PlahOIz fsWjZl22HFh/PfenqRXgrgvd4koZq7j2S80ORbY3gAsnhVNN5h5NiRffnWe3frtQtoOJ hntSoAy3IvMlyKpf/Qrx9vU7cWnKD5wqMVt7ASI1nnfx5a/zXw5MwoSCIE2FomPu0tgk G7MB0yPGgaXLeUBMEk0OLMD21NCqXJqwI5rZNF8Bw8gdKB/lUlNyYJoGOU1RsBgDqoBc v7bDhMfvp40Z+u5SZPxrMU7tT5wpGRtH+vwgWvcEjyfD2YnokFMHVFZsU8+1iq2q6KAJ G6mA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Rmoj8mVp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y4si10188935ejf.479.2021.02.01.02.50.46; Mon, 01 Feb 2021 02:51:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Rmoj8mVp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233039AbhBAKuC (ORCPT + 99 others); Mon, 1 Feb 2021 05:50:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232714AbhBAKuA (ORCPT ); Mon, 1 Feb 2021 05:50:00 -0500 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75D5AC061574; Mon, 1 Feb 2021 02:49:20 -0800 (PST) Received: by mail-pl1-x629.google.com with SMTP id p21so17857pld.8; Mon, 01 Feb 2021 02:49:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3ahVfaMAWzVEmDVakumdMajUgJJioFFzCyRQz4vDITs=; b=Rmoj8mVpr1W7qSeYZBZ0qhcys4NlgEkxlzHARgrrzK0bU0xgpWaD8jygwlPmiWCDyU NVQqBQNNEJ3++zbaToXcHRYb5fYuyAOUCWC+DDS8cYrEVCjpnU+c8qESkyg/cL3oJVvZ E3tQcp0e1yg+yhxAvo+F55prKc+eX2OSK7UCv25a/W1BYXjpc/YJDeAb57L9CbfqLcYR apmT+tduUXgHmP2IZ5HMh0gcqpjK+kjO0vbWopdcT0KgGWQCddBniXrT6JgGVMI+14DW bH9CQjn6JRX1zArG1tKsQd9kZWycm4Pac3mjCAc1+Nj3ce4WDjzqo3V7jbxqQE7be+E/ CLjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3ahVfaMAWzVEmDVakumdMajUgJJioFFzCyRQz4vDITs=; b=E/55DDhPx2lnzMfTnCdyoNU+W1eon2ci9nTiGHYNlJ3VYlgkkdD+NMLq76IxC0F0nj ZITf7rDuBijK84RUAOArwAHuzJRGFq4S5L+jqI2jVAASEBSBP7QMIbBQMuzxi5izMd+u 13REZ5iQDUw/RmeOZ6cnjzPCaiiIgImGFvgloAIgfV2P5if8yQYdolLMBE5VDA+hSKm1 o6v8fhFKPUiN0M1nUb7smRVYuyfTTIjcFwoyjv/aX6uAE3srbqvSNQp4WjdPRt7KYI+v /6fdvOkEcbHNgDPG0JXhjuq8DPoHQeVErLF7eFkQI4hwhmLaADSSGi5nMfgXdJqi4IzU kmQA== X-Gm-Message-State: AOAM532UzZ7BDcgCX6VyDHmIqX4btxg8C3advDinbtfFiUDnlBM3Hlh8 JQPvNIG2QaJenorBsRgW2nm1E0r1d5wAhg0g/PM1To7oU0Q= X-Received: by 2002:a17:90a:ee8a:: with SMTP id i10mr2471119pjz.210.1612176560078; Mon, 01 Feb 2021 02:49:20 -0800 (PST) MIME-Version: 1.0 References: <20210201055706.415842-1-xie.he.0141@gmail.com> <204c18e95caf2ae84fb567dd4be0c3ac@dev.tdt.de> In-Reply-To: <204c18e95caf2ae84fb567dd4be0c3ac@dev.tdt.de> From: Xie He Date: Mon, 1 Feb 2021 02:49:09 -0800 Message-ID: Subject: Re: [PATCH net] net: lapb: Copy the skb before sending a packet To: Martin Schiller Cc: "David S. Miller" , Jakub Kicinski , Linux X25 , Linux Kernel Network Developers , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 1, 2021 at 2:05 AM Martin Schiller wrote: > > What kind of packages do you mean are corrupted? > ETH_P_X25 or ETH_P_HDLC? I mean ETH_P_X25. I was using "lapbether.c" to test so there was no ETH_P_HDLC. > I have also sent a patch here in the past that addressed corrupted > ETH_P_X25 frames on an AF_PACKET socket: > > https://lkml.org/lkml/2020/1/13/388 > > Unfortunately I could not track and describe exactly where the problem > was. Ah... Looks like we had the same problem. > I just wonder when/where is the logically correct place to copy the skb. > Shouldn't it be copied before removing the pseudo header (as I did in my > patch)? I think it's not necessary to copy it before removing the pseudo header, because "skb_pull" will not change any data in the data buffer. "skb_pull" will only change the values of "skb->data" and "skb->len". These values are not shared between clones of skbs, so it's safe to change them without affecting other clones of the skb. I also choose to copy the skb in the LAPB module (rather than in the drivers) because I see all drivers have this problem (including the recently deleted x25_asy.c driver), so it'd be better to fix this issue in the LAPB module, for all drivers.