From: Jason Wang Subject: Re: [PATCH net] net: validate untrusted gso packets Date: Wed, 17 Jan 2018 19:58:24 +0800 Message-ID: <186d8595-467f-0337-8197-661c4f19248b@redhat.com> References: <20180116202914.205914-1-willemdebruijn.kernel@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Cc: Network Development , David Miller , Eric Dumazet , Willem de Bruijn To: Willem de Bruijn Return-path: Received: from mx1.redhat.com ([209.132.183.28]:59520 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753060AbeAQL6k (ORCPT ); Wed, 17 Jan 2018 06:58:40 -0500 In-Reply-To: Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 2018年01月17日 12:56, Willem de Bruijn wrote: >> This just makes that check more strict. Frequency of malicious packets is >> not really relevant if a single bad packet can cause damage. >> >> The alternative to validate on kernel entry is to harden the entire segmentation >> layer and lower part of the stack. That is much harder to get right and not >> necessarily cheaper. >> >> As a matter of fact, it incurs a cost on all packets, including the common >> case generated by the protocol stack. > If packets can be fully validated at the source, we can eventually also > get rid of the entire SKB_GSO_DODGY and NETIF_F_GSO_ROBUST > logic. Then virtio packets won't have to enter the segmentation layer > at all for TSO capable devices. On the contrary I think, if I read the code correctly, the point is to delay the check as much as possible. Then for GSO_ROBUST device, we don't even need to do any header check at all. This help for performance. What's more, the check should be done layer by layer which makes gso_segment a perfect place to do that. Thanks