From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Abeni Subject: Re: [PATCH net-next v2 1/2] udp: msg_zerocopy Date: Mon, 26 Nov 2018 17:32:19 +0100 Message-ID: <11350ff03fc6b03e34f8b4acd063371c887758d8.camel@redhat.com> References: <20181126152939.258443-1-willemdebruijn.kernel@gmail.com> <20181126152939.258443-2-willemdebruijn.kernel@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: davem@davemloft.net, Willem de Bruijn To: Willem de Bruijn , netdev@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:56758 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726719AbeK0D05 (ORCPT ); Mon, 26 Nov 2018 22:26:57 -0500 In-Reply-To: <20181126152939.258443-2-willemdebruijn.kernel@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: Hi, Sorry for the long delay... On Mon, 2018-11-26 at 10:29 -0500, Willem de Bruijn wrote: > @@ -1109,6 +1128,7 @@ static int __ip_append_data(struct sock *sk, > error_efault: > err = -EFAULT; > error: > + sock_zerocopy_put_abort(uarg); > cork->length -= length; > IP_INC_STATS(sock_net(sk), IPSTATS_MIB_OUTDISCARDS); > refcount_add(wmem_alloc_delta, &sk->sk_wmem_alloc); Out of sheer ignorance on my side, don't we have a bad reference accounting if e.g.: - uarg is attached to multiple skbs, each holding a ref, - there is a failure on 'getfrag()' Such failure will release 2 references (1 kfree_skb(), and another in the above sock_zerocopy_put_abort(), as the count is still positive). Cheers, Paolo