From mboxrd@z Thu Jan 1 00:00:00 1970 From: Martin Schiller Subject: Re: [PATCH net] net: lapb: Copy the skb before sending a packet Date: Mon, 01 Feb 2021 13:47:54 +0100 Message-ID: References: <20210201055706.415842-1-xie.he.0141@gmail.com> <204c18e95caf2ae84fb567dd4be0c3ac@dev.tdt.de> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-ID: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: Xie He Cc: "David S. Miller" , Jakub Kicinski , Linux X25 , Linux Kernel Network Developers , LKML 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