Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp878531ybi; Fri, 12 Jul 2019 06:08:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqy9TfLc9VeTosvOCT7bWXXnqxNJG9Z9eWxMCxOR0rTsTdEgdQIH95x3NQflnMhz4DiMH5qf X-Received: by 2002:a63:5920:: with SMTP id n32mr10401245pgb.352.1562936900927; Fri, 12 Jul 2019 06:08:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562936900; cv=none; d=google.com; s=arc-20160816; b=q1R0jBqlN7g7vcS6bRtOMktnGqYkPPzunOuscNa3oCMNwEPL6YsKUu6+x9NWU39mtt COwu4CBx4Bd0t9XMhgkBQ9gw+/gp364We0BHl4WrUDgT0NDhvjB32sb2k0UUsKUa18wg ectYjHhtmiq9aCUEXSNZaCJR0DfGdMMGqJvmywUV50TpKlA2QmtRapsxXSzNI7JYstJo 2ovD7VKPtq0wsjg6DnIG1plK4SA7wqKXltOxZXUboQvHawBwsM8QjG/TfdePV4elsUSD XjmFMXox3wfiEVuN6Pg1Im9ZlpB8+JEXqFdZNW4eC5ETf8aza7RdHhdo5kgfxTEHQ836 XPSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=/7XkiRkR3X4BsLfWt2Q5BQTTq/dYNKGgpj2GG8wPfcE=; b=cAJSglOhUVYucFpgiEwW7fGfMYW1gKT6jQuNy0Mz9ioPxqFQh1OI8eoP9YA/7VVQWQ 9EBdOzRo++ic9WlPpfp2z8d7HlSGDAIP7/0fS34X1l85MVtqEg7KXi8qP9Laut2HIG95 uXsabhdKY8cXiCh90V7MG0zpNGy3XWr4ps5o+1Y1oiEBTRYDJ8JTW0025o+A/fEawI8R sAE4PYBgkOEw4kW6EUQVjb0nSOqpo4YTj9rs+SHOcfnLibV5sKS+ac9Zhk6In8SGKiQG DL8mqa2AJyKHLGdS0DrdpcqK+0DmucRcUFz/ZDP+duuvCw2gpSqEZ5rSCsg2Ko+F7ekx v/1Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u12si8201064pfm.6.2019.07.12.06.08.05; Fri, 12 Jul 2019 06:08:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727514AbfGLNHd (ORCPT + 99 others); Fri, 12 Jul 2019 09:07:33 -0400 Received: from www62.your-server.de ([213.133.104.62]:50736 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726449AbfGLNHd (ORCPT ); Fri, 12 Jul 2019 09:07:33 -0400 Received: from [78.46.172.3] (helo=sslproxy06.your-server.de) by www62.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1hlvGh-0005ei-8M; Fri, 12 Jul 2019 15:07:19 +0200 Received: from [2a02:1205:5069:fce0:c5f9:cd68:79d4:446d] (helo=linux.home) by sslproxy06.your-server.de with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1hlvGh-0005Qo-03; Fri, 12 Jul 2019 15:07:19 +0200 Subject: Re: [PATCH bpf] xdp: fix possible cq entry leak To: Ilya Maximets , netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, bpf@vger.kernel.org, xdp-newbies@vger.kernel.org, "David S. Miller" , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Magnus Karlsson , Jonathan Lemon , Jakub Kicinski , Alexei Starovoitov References: <20190704142503.23501-1-i.maximets@samsung.com> From: Daniel Borkmann Message-ID: <47c7cc21-6e4c-63a6-7649-5486fcd43607@iogearbox.net> Date: Fri, 12 Jul 2019 15:07:18 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20190704142503.23501-1-i.maximets@samsung.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.100.3/25508/Fri Jul 12 10:10:04 2019) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/04/2019 04:25 PM, Ilya Maximets wrote: > Completion queue address reservation could not be undone. > In case of bad 'queue_id' or skb allocation failure, reserved entry > will be leaked reducing the total capacity of completion queue. > > Fix that by moving reservation to the point where failure is not > possible. Additionally, 'queue_id' checking moved out from the loop > since there is no point to check it there. > > Fixes: 35fcde7f8deb ("xsk: support for Tx") > Signed-off-by: Ilya Maximets Applied, thanks!