From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH net] net/sched: fix memory leak in act_tunnel_key_init() Date: Wed, 05 Sep 2018 22:19:40 -0700 (PDT) Message-ID: <20180905.221940.1560675928974776288.davem@davemloft.net> References: Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: xiyou.wangcong@gmail.com, simon.horman@netronome.com, amir@vadai.me, jhs@mojatatu.com, netdev@vger.kernel.org To: dcaratti@redhat.com Return-path: Received: from shards.monkeyblade.net ([23.128.96.9]:55626 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725919AbeIFJxW (ORCPT ); Thu, 6 Sep 2018 05:53:22 -0400 In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: From: Davide Caratti Date: Tue, 4 Sep 2018 19:00:19 +0200 > If users try to install act_tunnel_key 'set' rules with duplicate values > of 'index', the tunnel metadata are allocated, but never released. Then, > kmemleak complains as follows: ... > This problem theoretically happens also in case users attempt to setup a > geneve rule having wrong configuration data, or when the kernel fails to > allocate 'params_new'. Ensure that tunnel_key_init() releases the tunnel > metadata also in the above conditions. > > Addresses-Coverity-ID: 1373974 ("Resource leak") > Fixes: d0f6dd8a914f4 ("net/sched: Introduce act_tunnel_key") > Fixes: 0ed5269f9e41f ("net/sched: add tunnel option support to act_tunnel_key") > Signed-off-by: Davide Caratti Applied and queued up for -stable.