From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: Re: [PATCH net-next] net: preserve sock reference when scrubbing the skb. Date: Wed, 27 Jun 2018 12:33:19 -0700 Message-ID: <096ada36-8e05-c330-e5b3-3f6fcc77aea2@gmail.com> References: <20180625155610.30802-1-fbl@redhat.com> <48e15faf-f935-0166-e1db-18f7286e7264@gmail.com> <20180626220300.GT19565@plex.lan> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Flavio Leitner , Linux Kernel Network Developers , Paolo Abeni , David Miller , Florian Westphal , NetFilter To: Cong Wang , Eric Dumazet Return-path: In-Reply-To: Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-Id: netfilter-devel.vger.kernel.org On 06/27/2018 11:59 AM, Cong Wang wrote: > > IIRC, this skb_orphan() was introduced much earlier than TSQ, probably > from the beginning of veth. Sigh SO_SNDBUF was invented years ago before veth. You focus on TSQ while it is only one of the many things that are broken. > > Leaving the stack should be effectively equivalent to leaving the host, > from the view of network isolation. > Having a UDP socket being able to burn a cpu and fill a qdisc is a major bug. Bu default (blocking send() syscalls) the following loop should block the thread if socket sk_wmem_alloc hits sk_sndbuf, this is the beauty of backpressure. while (1) send(fd, ...); With skb_orphan(), sk_wmem_alloc will stay around 0, so the loop will burn a cpu and fill a qdisc, eventually breaking "network isolation", since other sockets might be unable to send a single packet. If you have a concrete case where the skb_orphan() is needed, then you will have to add a parameter to let the admin opt-in for this.