Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3499522pxu; Tue, 15 Dec 2020 08:23:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJwqkB+DdwWHFXkgIjimOCBtlrRXQ7WE1CM1qUrzC5TQ+x22Ijhsx47mDwhYDYsd+7mlupyK X-Received: by 2002:a17:906:a192:: with SMTP id s18mr12782865ejy.249.1608049416426; Tue, 15 Dec 2020 08:23:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608049416; cv=none; d=google.com; s=arc-20160816; b=hlMABcvUJ48gUa+RZUkUba4DGwuJp399SPPH1M8phgozwcAmmVhpvm4iXtG9m6EOQf qqW0BHQWL/UUlCbHCU4d0OxYBkj93aeRjmaMTN57wC3sBsD909NHKAM1QUSV0oL2FTAF gHhB9EhK0MPm77B739qwK83aOqZjcCiyAlJmtlSb+0kDxvrY8aLRkQe/BKl+A7KLPk5Z ZqNR+oQEw0douR9SYDY2KlaoCVzu3UIxcwhWCRzgC56P5IrOizjKRYxpP6eXQ2UmyNYk unNn5EbAzYn7q26K9Lw5JA+igU44gmjXAnBcxC9/W3xnVs5gwzzP5py1mx9FreMy+Lnx 3AGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=EAviskxqTexP6X4iUU767taANG5/40ekq2ZxCAijnS0=; b=TQ0nI4m9mDlOKkNeu5cheuN0xYX4gSUa3HxnW4DyShaCtMClk3GFuP1mrhkfn4HWiz Q4Y+IVas6JaluVllvfsuUaL4w5f+eZ3BlDuQqmJcow1jDjJR6ea2JruCcNS1yKv63/iC ZELcsCEtL6hiBtE5pr7oAQ66n2tyuTCxIywh7TZ7MGLbyys5hIBAlGbAcoGu/MuErYNj LckyBjIU7jX1fTw9aq2VXAMLPfo2dulG9NNiztyMBAyshtOTbIAyZaic1PV8itdRj6mO 79NOiW6dfYktJmdGQiZT3aUIbuf3V8vncEhddvGCsyjfWUZ8iWFpPYvDIfflQFhuujmZ EYjQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f20si1085822ejx.289.2020.12.15.08.23.12; Tue, 15 Dec 2020 08:23:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730786AbgLOQVH (ORCPT + 99 others); Tue, 15 Dec 2020 11:21:07 -0500 Received: from correo.us.es ([193.147.175.20]:43660 "EHLO mail.us.es" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729786AbgLOQUi (ORCPT ); Tue, 15 Dec 2020 11:20:38 -0500 Received: from antivirus1-rhel7.int (unknown [192.168.2.11]) by mail.us.es (Postfix) with ESMTP id D80AB103299 for ; Tue, 15 Dec 2020 17:19:37 +0100 (CET) Received: from antivirus1-rhel7.int (localhost [127.0.0.1]) by antivirus1-rhel7.int (Postfix) with ESMTP id CAA78DA73D for ; Tue, 15 Dec 2020 17:19:37 +0100 (CET) Received: by antivirus1-rhel7.int (Postfix, from userid 99) id BE255DA7E1; Tue, 15 Dec 2020 17:19:37 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on antivirus1-rhel7.int X-Spam-Level: X-Spam-Status: No, score=-108.2 required=7.5 tests=ALL_TRUSTED,BAYES_50, SMTPAUTH_US2,URIBL_BLOCKED,USER_IN_WELCOMELIST,USER_IN_WHITELIST autolearn=disabled version=3.4.1 Received: from antivirus1-rhel7.int (localhost [127.0.0.1]) by antivirus1-rhel7.int (Postfix) with ESMTP id 93206DA78F; Tue, 15 Dec 2020 17:19:35 +0100 (CET) Received: from 192.168.1.97 (192.168.1.97) by antivirus1-rhel7.int (F-Secure/fsigk_smtp/550/antivirus1-rhel7.int); Tue, 15 Dec 2020 17:19:35 +0100 (CET) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/antivirus1-rhel7.int) Received: from us.es (unknown [90.77.255.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: 1984lsi) by entrada.int (Postfix) with ESMTPSA id 6A32142EFB80; Tue, 15 Dec 2020 17:19:35 +0100 (CET) Date: Tue, 15 Dec 2020 17:19:50 +0100 X-SMTPAUTHUS: auth mail.us.es From: Pablo Neira Ayuso To: Colin King Cc: Jozsef Kadlecsik , Florian Westphal , "David S . Miller" , Jakub Kicinski , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH][next] netfilter: nftables: fix incorrect increment of loop counter Message-ID: <20201215161950.GA10902@salvia> References: <20201214234015.85072-1-colin.king@canonical.com> <20201215143830.GA10086@salvia> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20201215143830.GA10086@salvia> User-Agent: Mutt/1.10.1 (2018-07-13) X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 15, 2020 at 03:38:30PM +0100, Pablo Neira Ayuso wrote: > Hi, > > On Mon, Dec 14, 2020 at 11:40:15PM +0000, Colin King wrote: > > From: Colin Ian King > > > > The intention of the err_expr cleanup path is to iterate over the > > allocated expr_array objects and free them, starting from i - 1 and > > working down to the start of the array. Currently the loop counter > > is being incremented instead of decremented and also the index i is > > being used instead of k, repeatedly destroying the same expr_array > > element. Fix this by decrementing k and using k as the index into > > expr_array. > > > > Addresses-Coverity: ("Infinite loop") > > Fixes: 8cfd9b0f8515 ("netfilter: nftables: generalize set expressions support") > > Signed-off-by: Colin Ian King > > Reviewed-by: Pablo Neira Ayuso > > @Jakub: Would you please take this one into net-next? Thanks! You marked as "Awaiting Upstream", I'll take care of it. Thanks.