Received: by 10.223.185.116 with SMTP id b49csp5456579wrg; Wed, 7 Mar 2018 12:04:53 -0800 (PST) X-Google-Smtp-Source: AG47ELvNeS5deI02SSoItQ8Forda/EF1dfpcrJYXTK9mlfXkt/0QegXsIQv2wvZ8Mecspx0MHdLy X-Received: by 2002:a17:902:7282:: with SMTP id d2-v6mr22002713pll.303.1520453093752; Wed, 07 Mar 2018 12:04:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520453093; cv=none; d=google.com; s=arc-20160816; b=rcl7dMmDuXqsrHV8IJqZGOKSYHD/nZNsCNEAkw0y6Clhgh3nxdbNjsukv9Cwm7fq7x XRGsNFtt+dNHJcvhHxc19FYtQPq2nsE965A2OX2Rq++zIj+JAwFWIdncUebueHA76thi BobOJQIRBI2kQkOl2yE33wftg+1v53+LNpGd1tctcFyi0oQgGmzTik7b9YA6HUS6YpgJ Ld1l7wRSCQt84/fFNITgJUGlQowd5hXi5kA5Q0eXomuXwgWPRdMeEHC9VSx0kTnP+1xD Seg8OmySM7G4V5vBx775bY6TwXgUNUxf4tCa0aBiOZoXcrYALeMCsfQuNHLW1AhRoMbN w23w== 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 :arc-authentication-results; bh=W06UZSuN2NmYzsZO5bGv2YWB/xWNFt4MA+XCoDr28jI=; b=iSCn+D/2L4hJt8QPm4gy/PSFm81FSh9fSN900WlJLHti26hUT1AlQWXbML3/QEsP4U +OtK6lfZPfV8RyaPh29lm1nCDFLm4LZoXkkokFMj10vq1YX8+iNp4GUpWMVodWrPfWko 3NRm2P5Td1zQMkEgtIOFIWYyJa1+Y+OMfcjKLLA00hpro0M0IolxcH6e/B0gLpyrFs2C F41RmE2NaGCeFSWOh6oPhg8ANEkqzysmBcaxgmURcWxwzHM1I0PAP0G6WwqL4SXTRvrM d1+/OK3Tea4a13dmM0VElJM6SdRRLhm5AiOUsuA3tzB10++93BRdL1vT8tSmMrYE9tHw zudQ== 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 m189si6190544pga.483.2018.03.07.12.04.38; Wed, 07 Mar 2018 12:04:53 -0800 (PST) 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 S965622AbeCGUDe (ORCPT + 99 others); Wed, 7 Mar 2018 15:03:34 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:44672 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965558AbeCGTqe (ORCPT ); Wed, 7 Mar 2018 14:46:34 -0500 Received: from localhost (unknown [185.236.200.248]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id EEC8D107A; Wed, 7 Mar 2018 19:46:33 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ido Schimmel , Nikolay Aleksandrov , "David S. Miller" Subject: [PATCH 4.14 065/110] bridge: Fix VLAN reference count problem Date: Wed, 7 Mar 2018 11:38:48 -0800 Message-Id: <20180307191047.877377830@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180307191039.748351103@linuxfoundation.org> References: <20180307191039.748351103@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: Ido Schimmel [ Upstream commit 0e5a82efda872c2469c210957d7d4161ef8f4391 ] When a VLAN is added on a port, a reference is taken on the corresponding master VLAN entry. If it does not already exist, then it is created and a reference taken. However, in the second case a reference is not really taken when CONFIG_REFCOUNT_FULL is enabled as refcount_inc() is replaced by refcount_inc_not_zero(). Fix this by using refcount_set() on a newly created master VLAN entry. Fixes: 251277598596 ("net, bridge: convert net_bridge_vlan.refcnt from atomic_t to refcount_t") Signed-off-by: Ido Schimmel Acked-by: Nikolay Aleksandrov Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/bridge/br_vlan.c | 2 ++ 1 file changed, 2 insertions(+) --- a/net/bridge/br_vlan.c +++ b/net/bridge/br_vlan.c @@ -157,6 +157,8 @@ static struct net_bridge_vlan *br_vlan_g masterv = br_vlan_find(vg, vid); if (WARN_ON(!masterv)) return NULL; + refcount_set(&masterv->refcnt, 1); + return masterv; } refcount_inc(&masterv->refcnt);