From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E7188C49EA3 for ; Mon, 28 Jun 2021 14:49:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CC1B961C7E for ; Mon, 28 Jun 2021 14:49:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235657AbhF1Ov0 (ORCPT ); Mon, 28 Jun 2021 10:51:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:54530 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236456AbhF1OtW (ORCPT ); Mon, 28 Jun 2021 10:49:22 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3F60461D21; Mon, 28 Jun 2021 14:36:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1624891013; bh=OsmF4LCD3tVpB9Z8Ou6EtdHWUVZOuNkNLH0qmlsUmIA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nvrFM6XS6EbYOrFK6JMjfLSOBAJhWpMU0P2rP6t2XJikKIid1zyK0/V0RQnDgLDcU s7GsT9dkDHFDEer7N7ocgvmLBFaNz7lHO1446UZ2wDp2YZl5cbGakUVkopHeZyZBtr 4kwDhzaSMLZa+EkY7R8BV1Kmfc4/GtfejEbNwuK2Pdec0eWsQUvuJOyMHpk2LlrKrf 1uV/zaSONqzMFbAx4+eyZJIKsqXexhnil7W8Lm7QiSk+XmFytK9yjMCCdbirjTUzOy uRwew/fC6Jb5glYI9P6f+AfzMSJkAhAz5pr5yIJbFk5p1apfOxVnj0UsUhkvvHR5g+ xIuCuk077SJZw== 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.14 26/88] rtnetlink: Fix regression in bridge VLAN configuration Date: Mon, 28 Jun 2021 10:35:26 -0400 Message-Id: <20210628143628.33342-27-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210628143628.33342-1-sashal@kernel.org> References: <20210628143628.33342-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.14.238-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-4.14.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 4.14.238-rc1 X-KernelTest-Deadline: 2021-06-30T14:36+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@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 fa3ed51f846b..3bcaecc7ba69 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -3648,10 +3648,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