From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D5B01C433E0 for ; Mon, 1 Feb 2021 12:50:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9765D64E9C for ; Mon, 1 Feb 2021 12:50:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231628AbhBAMuC (ORCPT ); Mon, 1 Feb 2021 07:50:02 -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-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