Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3883603pxv; Mon, 28 Jun 2021 15:38:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxkDCw7hZoNJdVNZaofBS3feYEVJQGwVPYpsYUvtWLvY/DPGT7PN6ROlk5l0WCpZoOCCT/C X-Received: by 2002:a05:6e02:11ac:: with SMTP id 12mr20452631ilj.173.1624919890852; Mon, 28 Jun 2021 15:38:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624919890; cv=none; d=google.com; s=arc-20160816; b=aZB/FmdAN+Lx9qN7WnSUvWu42+jU0hdwwUAkWqv3TOawXrpHvakjjpIQ9J7AyURMDT 94JoNo1+kqRt603X5oaCo9h9Red8jR26yn6TdaZ5jaWC8I4QGfj6B/GM1vDHQkkynTm7 KsBJsqQHlwhzr2kdRNGQoY+oBEN88Y+ibEBNR8JLQPTmETkAF8T9ubMYKRW2M8jC2Cy5 kmNxitgnA3tFfI+GqSyizLHlcFZXnh1n7Rq7YZVMSt4TIg0XlZaXPyFDiwKLovZ17FUt zpUOgE5gC32khvpWjWKYNJPP8pF3YI/ACPgIQectj80MqfOQp8SFYoN/ItHLR7HQBq3E ePCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=DXABotwJ8LlN2Q/u6z0RUbQBVeqmFUvNzkC0/T9vyCQ=; b=kKrwlhZggvGuNXGQ+KDiWwO6ThLGXOTPD74uIVZYKlqh6Hly8LGJihBzed/HmdtTyM pp5dyYh2bdkem18NziYYuGSQ1hhjxEeklEp7p/PU3QJqh9WVaTnkJGfrO0f81YojlEMM 245RGKRoAVA+ZWh5584sZqGRMIEUbI2PhWThspKdZOzW9ymiAkmjnxybumrAMNBEEP3K E10p1+J78BDvCGw9QhbyhRN+2+8K+JB4ElxKG0OKAHtF0YNyBKuA3l9C2vIRINJd2mKy fiJYvnm8zwd5kKo1jZlJzV0FcKX7t+VixVl60KnMVZgS4RCV07WF8MYxUUddF3qWpCM9 YA+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="slU48Kl/"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b6si4703432ile.124.2021.06.28.15.37.57; Mon, 28 Jun 2021 15:38:10 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="slU48Kl/"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233653AbhF1P2e (ORCPT + 99 others); Mon, 28 Jun 2021 11:28:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:37110 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235717AbhF1PEN (ORCPT ); Mon, 28 Jun 2021 11:04:13 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 88CAB61CEA; Mon, 28 Jun 2021 14:43:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1624891393; bh=eSZagC5ScpX3j4NgnygCVTYa6DhptfoBQf87XDPWdgs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=slU48Kl/95vJA8ghWIpqe7sFgISSfp/IugcSRo/SjwYZc44F2gMly6KFap1CfVydA dSVlCG57GPhewxTtkdjJp1JB1karCz1BNDNvVFCME+cf9WS5mzmgd59QpqzNJz4PqA uRySPDqDNQdMohi0oH5TbSpqucjLZu4qTDrpggcAKyHKCMVR+909QX4QnUg6McI1LH tqtlUt78kkXn/OQvmbCeEWo0keLeh3s3EQhSFJ0PXccBDPUSpUrX/NCLQ/B7sZGuv6 9fwGw/jc6Xbmoc+R+55GFlXB3znmj6G6Du5W/DRedAhbb2TmII2PyFybPfeWczBfk/ BchC1V5isHluw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Ido Schimmel , Nikolay Aleksandrov , "David S . Miller" , Sasha Levin Subject: [PATCH 4.4 17/57] rtnetlink: Fix regression in bridge VLAN configuration Date: Mon, 28 Jun 2021 10:42:16 -0400 Message-Id: <20210628144256.34524-18-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210628144256.34524-1-sashal@kernel.org> References: <20210628144256.34524-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.4.274-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-4.4.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 4.4.274-rc1 X-KernelTest-Deadline: 2021-06-30T14:42+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ido Schimmel [ Upstream commit d2e381c4963663bca6f30c3b996fa4dbafe8fcb5 ] Cited commit started returning errors when notification info is not filled by the bridge driver, resulting in the following regression: # ip link add name br1 type bridge vlan_filtering 1 # bridge vlan add dev br1 vid 555 self pvid untagged RTNETLINK answers: Invalid argument As long as the bridge driver does not fill notification info for the bridge device itself, an empty notification should not be considered as an error. This is explained in commit 59ccaaaa49b5 ("bridge: dont send notification when skb->len == 0 in rtnl_bridge_notify"). Fix by removing the error and add a comment to avoid future bugs. Fixes: a8db57c1d285 ("rtnetlink: Fix missing error code in rtnl_bridge_notify()") Signed-off-by: Ido Schimmel Reviewed-by: Nikolay Aleksandrov Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/core/rtnetlink.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 11d2da8abd73..7d6fe9ba9a24 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -3240,10 +3240,12 @@ static int rtnl_bridge_notify(struct net_device *dev) if (err < 0) goto errout; - if (!skb->len) { - err = -EINVAL; + /* Notification info is only filled for bridge ports, not the bridge + * device itself. Therefore, a zero notification length is valid and + * should not result in an error. + */ + if (!skb->len) goto errout; - } rtnl_notify(skb, net, 0, RTNLGRP_LINK, NULL, GFP_ATOMIC); return 0; -- 2.30.2