Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2009856imm; Thu, 24 May 2018 04:28:12 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpONQQBSAL/KheGjrtnBzddhZCJ8V7w8sqgcPmicgoZ+wxeTlKNIEqLLxZFxJPiBSuGgMSI X-Received: by 2002:a17:902:3081:: with SMTP id v1-v6mr7133239plb.266.1527161292000; Thu, 24 May 2018 04:28:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527161291; cv=none; d=google.com; s=arc-20160816; b=CZ1suBoCzfGMRzmp5haAXCHN5nbOf8ZSIZWNhV3PrT/0+WgPLmdLMsNbwphtjcOQEt sXHSHZDgbZOHyWA12NZv7GNUo1OD2V8gGZsi1dIWaGaEN93F4p8LnU6J5Bd328kGPFxE UhMHVqgXBzT1jYCpvySid672UwEvbr2VDsgFryqKuz4+bYxH9pEcrR5OeamWHy8nEUm2 3ACWVyZlE8ftesCrs39eE7wNMV3NJZWDK8wLKQaMWH0Y+6V6Vvj7viw16x1AUmpOXhaQ vFVhw6XYm86cLekr8RavHy5G6eN/9UXGb7fuc9dQlI0lKp+/czyKLIskUcG7eMcLJR9+ WxCw== 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=wtrvhOKWlDCR43FwXlOy8WJivC8PZOYM4Hgc7tQjoa0=; b=y3vjFQyy8J6p2nWTn9Xrs3TqkZQqykeGdUVJYKfvTnoXZaGAygqKWi/SGkb9I9SZW0 pxoVboKGIFTMGyBhTDsXmWrQiXiznvu3KFVE9daa3KsuvvvO/fKiLebCM2CtgDda4ECd bAyipd8vvaEUt+VlJ58QB1+QOcaNkCAXZ2UubmaSTQrptcMm7epnArra/ZcvJZtaqFWd 6mUMlz7vJc96sZpUR2OrJ92BhOk05pO7ETsB6Lf51hs5dd6bnpdjrq9i53WB7UR3LCNO 9CFcZN8gvoYMLSv0GR2GiuuSl+oIWfT2CCPhhBBTRDO83oxkyb3yeeOqQVQQWk34j6Ya jwCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=c9lhv2X9; 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 c14-v6si20669843pfe.29.2018.05.24.04.27.57; Thu, 24 May 2018 04:28:11 -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=c9lhv2X9; 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 S968861AbeEXL0K (ORCPT + 99 others); Thu, 24 May 2018 07:26:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:47536 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967737AbeEXJvi (ORCPT ); Thu, 24 May 2018 05:51:38 -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 9074720847; Thu, 24 May 2018 09:51:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527155498; bh=WYDQm9dext7KZoZr5OEEqt4Ezf7W+YG9/nYrhxXtoo0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c9lhv2X9DUr/+vGVaDbxpR+NXH+EJy8Q6OeU36Wp+fh74hADwcIvQ7OQ9/Kaznq8K C85y8FIgiyDnkPKw8c9VkItChBM4PsEBLTn7td1EYJUmgz2fGIGnIBQWGRTV1GFffh HV8nwswjvgGS+dvSPGRoP0mRObfG6tpT4eF3mf8I= 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.14 003/165] net/sched: fix refcnt leak in the error path of tcf_vlan_init() Date: Thu, 24 May 2018 11:36:49 +0200 Message-Id: <20180524093622.111576919@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093621.979359379@linuxfoundation.org> References: <20180524093621.979359379@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.14-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 @@ -154,6 +154,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 {