Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3826230pxv; Mon, 28 Jun 2021 13:58:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZItHuaR/iDOAe4Qdy5hXPJoEV142SQuGzuckSZP/0Os5AfmHejY/R2almK2o5aXzGFgIS X-Received: by 2002:a05:6402:10c3:: with SMTP id p3mr33015528edu.175.1624913880753; Mon, 28 Jun 2021 13:58:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624913880; cv=none; d=google.com; s=arc-20160816; b=cpzgFf0sg4HINL0HdE/nhvlF4dw762/AvRVM85RYVzqwIwcIqHgjDgTqs9PP4lqAFp ADocFfwfNs01JwBk64JVMVc3VKWcoRNU3O2TDQP9Vou6Sm6i2r12bmBgit8G5fvi9xXr SwjmNEKZELdSX3l+SfFPIKTxgC23A/j5OsskQoUD2l0HhHhR1W0aCPZmq+tSy+NNsqKJ l0P13045q9KGnpjYH/53/EPcpwVyrvnDooMp1puNC8LPpeVXHSsACpU2nSX9XZ1iGQ/Z pdEKKB7H6nBeH9ksg//PMK8SfQBgWpoMIv0htv+gtAU8VZPj6kav4oJd5/qikSyloluh Emlw== 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=7dSfNOyqWdU5UDvnaZ+37S7IeYxcPE9ez1Sq35RetZg=; b=GuKsZLU6E9ZpGIaG2DAkKnmEq2cIsKtbX/fLzLBOSs/dPotPn+xSvB7mNln9Y2Vb7v OyNMVbIpNuzGth7jW4vOT+BzSEHdfH8kmath/s+d2/AvUTwzPk6R4wX++WDv26Z3rTPA 4AtwY/NGFbotoDG6OyqzHH+z8qbvc75AuBNc4Kl5ObOCm+8SXgZe4vKQRKGhZtAw8DsO zr4CPmI1cMpuzUs6jnUSb4jd3d12cPLhE7v5UGiM5dlPxV3lInO7fJ0Prl4EvW0JRLsh 8tIysz3uDmYifwdwLbHciDfGyYXvWMmrONZBCWt1mPZUq7cEg+vF2/i3QVu5wD4av5dX zvow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nvrFM6XS; 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 o8si16957327ejj.94.2021.06.28.13.57.24; Mon, 28 Jun 2021 13:58:00 -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=nvrFM6XS; 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 S237688AbhF1PKK (ORCPT + 99 others); Mon, 28 Jun 2021 11:10:10 -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: 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 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