From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH 0/3] Check gso_size of packets when forwarding Date: Mon, 22 Jan 2018 13:31:25 -0800 Message-ID: <20180122133125.55e2730e@xeon-e3> References: <871sim5abx.fsf@linkitivity.dja.id.au> <20180122.151453.1675721993605626060.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: pshelar@ovn.org, dja@axtens.net, netdev@vger.kernel.org, Manish.Chopra@cavium.com, dev@openvswitch.org To: David Miller Return-path: Received: from mail-pg0-f65.google.com ([74.125.83.65]:38116 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750953AbeAVVb3 (ORCPT ); Mon, 22 Jan 2018 16:31:29 -0500 Received: by mail-pg0-f65.google.com with SMTP id y27so8093617pgc.5 for ; Mon, 22 Jan 2018 13:31:29 -0800 (PST) In-Reply-To: <20180122.151453.1675721993605626060.davem@davemloft.net> Sender: netdev-owner@vger.kernel.org List-ID: On Mon, 22 Jan 2018 15:14:53 -0500 (EST) David Miller wrote: > From: Pravin Shelar > Date: Fri, 19 Jan 2018 13:54:15 -0800 > > > I agree it is not perfect. But the other proposed patch does not fix > > the connectivity issue. It only adds log msg in such cases at cost > > of extra checks/code. Therefore I prefer the easier fix for the > > issue which also fixes for all cases of packet forwarding rather > > than just OVS and Bridge. > > I really think that something needs to guarantee that device drivers > will never be given either over-MTU or over-max-GSO-seg-size SKBs. > > Otherwise drivers need to add completely stupid checks like making > sure that SKB lengths do not exceed the maxmimu value that can be > encoded into descriptors. > > What's probably happening often now in such situations is that the > driver ends up masking the length blindly and ends up sending out a > truncated packet. > > Which frankly is quite bad too. > > It doesn't scale to add these checks into every driver, or trying to > "figure out" which drivers will behave adversely and only add checks > to those. > > The kernel shouldn't pass objects with out-of-range attributes > to the driver, period. Agreed. We should make it easier to write non-buggy drivers.