Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1960533imm; Thu, 24 May 2018 03:38:19 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoUcbtE8uK4Z6n4S4msEJdI0XgBoCKsFFIb7Kv3IqzK2qErCD/6JXVuhp5Q9eqdVzMrCUCB X-Received: by 2002:a62:105:: with SMTP id 5-v6mr6654868pfb.1.1527158299030; Thu, 24 May 2018 03:38:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527158299; cv=none; d=google.com; s=arc-20160816; b=smrdYiS9IPA+S4o9FjEYNpEI/whuf7y+l49Z0t3OI/r/zExsJ7thsWOTKU8BrqZEM0 xCIbMmC09uLA6O7Vce8qWdEkRJRAy9FuOQv2Kl+F0ZwTy7T96PaI17wV5dXXcD5nftff 9H0M/x6tMpCrRFuwYbOSYQVgbdlajovdHD2WxfOIHVFsHQ96bOrEQ1iSWe7y1MctK//o 5RBvNEH8f5lFEVklB273mH7sMdKw6mx73FsfN0CbKQvlrMibCyfpP+41eL32hOSKEDgj 6IlrNy6dzPrbRfE8vk5KqxJRWl4Bh1npaBw8hpi4A9L4L+qFDSXlDsAAo5nReRrzZlLt gHvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=kxRTwnqKW+jxLk8LHj6dy1Y8/kMVsOwkJeJpdHgL4q0=; b=p3CejZqCDZYoQe/mwkxhmToe+SYizUKnTu3UZ4wssfwEoR1A2acpZ1M/kmFPbVEYUr D5rsxI5psfC1/qwnA3x5PuJ+MC4SiWeKrn0LfQQsZR4o5BSXjePMFYvOzi1k81+TvEP6 WsH35XxGWNj4L82jf7e1ORk7//49cEqxvKHrnyly+0DriL+s1qMv4VuZr5jR3TEIubCL pdQKw/T2ctTsriPHxTj1VInKNyS09UwzF0vgZi00iJRxN3k2u9qdxI1BDUgyeTOKkunE TGi48c5zO4Ne1mQcNOdn8R0VqqSb+0hHI8eBj7AQ6kSmJtAiofTAdDpEsuqIhfMzxP6r xc2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nABJRlBr; 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 t5-v6si21010546plo.113.2018.05.24.03.38.04; Thu, 24 May 2018 03:38:19 -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; dkim=pass header.i=@kernel.org header.s=default header.b=nABJRlBr; 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 S968581AbeEXKh3 (ORCPT + 99 others); Thu, 24 May 2018 06:37:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:41142 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030817AbeEXJ7s (ORCPT ); Thu, 24 May 2018 05:59:48 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B402520890; Thu, 24 May 2018 09:59:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527155988; bh=sCzFLWtmbLzb0F5E5eCuqZ6/2tJPHxNVXKlUv5VbmPE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nABJRlBrRABV3lcdQYvcCkGu81ZSta2SyfVgKe9N4xE7TathS/M3mKYAJYIg9q4r8 a/ka3Ogs33dJwqZPDzxXsMmdcQHqOZGVJud6KhKocP/a40+KVjg+35jHMnzq1Q4Bjj QnlCWlpigDS8KaMcFxKGLCQaHBiX0REX20+Ba/2s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Roman Mashak , Davide Caratti , Jamal Hadi Salim , "David S. Miller" Subject: [PATCH 4.16 004/161] net/sched: fix refcnt leak in the error path of tcf_vlan_init() Date: Thu, 24 May 2018 11:37:09 +0200 Message-Id: <20180524093018.881882967@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093018.331893860@linuxfoundation.org> References: <20180524093018.331893860@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Davide Caratti [ Upstream commit 5a4931ae0193f8a4a97e8260fd0df1d705d83299 ] Similarly to what was done with commit a52956dfc503 ("net sched actions: fix refcnt leak in skbmod"), fix the error path of tcf_vlan_init() to avoid refcnt leaks when wrong value of TCA_VLAN_PUSH_VLAN_PROTOCOL is given. Fixes: 5026c9b1bafc ("net sched: vlan action fix late binding") CC: Roman Mashak Signed-off-by: Davide Caratti Acked-by: Jamal Hadi Salim Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/sched/act_vlan.c | 2 ++ 1 file changed, 2 insertions(+) --- a/net/sched/act_vlan.c +++ b/net/sched/act_vlan.c @@ -161,6 +161,8 @@ static int tcf_vlan_init(struct net *net case htons(ETH_P_8021AD): break; default: + if (exists) + tcf_idr_release(*a, bind); return -EPROTONOSUPPORT; } } else {