Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3785374pxb; Mon, 1 Feb 2021 04:51:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJxHDDQHNtYb0w4zJovizA6gCTI+OVkd40ejjdQ6mOrr4FPwS4UBbf+bZwV8HPZb6XeGJvnf X-Received: by 2002:a17:906:f0c3:: with SMTP id dk3mr17273432ejb.540.1612183894951; Mon, 01 Feb 2021 04:51:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612183894; cv=none; d=google.com; s=arc-20160816; b=AqbKVNgxsbpK/CvOwJu71V/1tVWHt4pbNrXQStrVdZhO8cq8KkBOB0d2TEj5EbjuSa b426LmQwlQyHgBp69qElvHQ41TLRdyl6vCi0yedpnItnLINhzh0F7yKi7vF3H/+1CCko 3lGhEOPMhJ7s+AKWdygAByZNLtESubulCCapGsrV6ufPP3O9dDDIa6rWgHRBXmIVWz4y bmIXDlEWuzEZsPLwM/0mykzU3dek/B1rIha5WE7+zfQDE20uwRJ6DMNamizZVzIL/K+I sSY6xXb38pU2GBj6XN+f9AIZ0OVI31SlwvA1gug6MZ9HuQTku4V+zGKtmB2ByqWlO+ad z+Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:message-id:references:in-reply-to :organization:subject:cc:to:from:date:content-transfer-encoding :mime-version; bh=6zkz7O+hyoilK+iO7hSQJfulNN6+DpET4T0e4ziXMZg=; b=ZlvtIymdfQIhuwfYnecFoYMEWoY84A+JOHtXj+PYvVpopPIqApfqjjg14iLh0sLKae f8swdyoty3aav+0gtQ/rqtM8xpQDdCqzOjF9zvOxdhRWX/a+zGLvcJqvpM7uceeS1rbC 2UVBBg3+SzEggdMxNJguki39pEk6HPoLNTTWzVh2wlLXg5dAf91OoWz0NZscsG6Ydzjc QX6vv64MsOYCHogGVnmIbCYbKq/3nVLeuxalzZ86RGbjM6Y069S5mUEMAlb3MobJAFwA cnTKQjev2Ui/93A1vmheuVG29/34F8avx4OpQzwVLrYP/zA82bVg1x0XYkpDYNoFg5JS ugjA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g9si10452998ejj.456.2021.02.01.04.51.09; Mon, 01 Feb 2021 04:51:34 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231612AbhBAMtw (ORCPT + 99 others); Mon, 1 Feb 2021 07:49:52 -0500 Received: from mxout70.expurgate.net ([91.198.224.70]:14964 "EHLO mxout70.expurgate.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231542AbhBAMts (ORCPT ); Mon, 1 Feb 2021 07:49:48 -0500 Received: from [127.0.0.1] (helo=localhost) by relay.expurgate.net with smtp (Exim 4.92) (envelope-from ) id 1l6YcW-0002U3-V9; Mon, 01 Feb 2021 13:47:57 +0100 Received: from [195.243.126.94] (helo=securemail.tdt.de) by relay.expurgate.net with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l6YcW-000JY7-4m; Mon, 01 Feb 2021 13:47:56 +0100 Received: from securemail.tdt.de (localhost [127.0.0.1]) by securemail.tdt.de (Postfix) with ESMTP id 943B0240041; Mon, 1 Feb 2021 13:47:55 +0100 (CET) Received: from mail.dev.tdt.de (unknown [10.2.4.42]) by securemail.tdt.de (Postfix) with ESMTP id 1F4B5240040; Mon, 1 Feb 2021 13:47:55 +0100 (CET) Received: from mail.dev.tdt.de (localhost [IPv6:::1]) by mail.dev.tdt.de (Postfix) with ESMTP id B33CA2007C; Mon, 1 Feb 2021 13:47:54 +0100 (CET) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 01 Feb 2021 13:47:54 +0100 From: Martin Schiller To: Xie He Cc: "David S. Miller" , Jakub Kicinski , Linux X25 , Linux Kernel Network Developers , LKML Subject: Re: [PATCH net] net: lapb: Copy the skb before sending a packet Organization: TDT AG In-Reply-To: References: <20210201055706.415842-1-xie.he.0141@gmail.com> <204c18e95caf2ae84fb567dd4be0c3ac@dev.tdt.de> Message-ID: X-Sender: ms@dev.tdt.de User-Agent: Roundcube Webmail/1.3.16 X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.dev.tdt.de X-purgate-ID: 151534::1612183676-00013921-746CED97/0/0 X-purgate: clean X-purgate-type: clean Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-02-01 11:49, Xie He wrote: > 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. OK. Acked-by: Martin Schiller