Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3922739pxj; Mon, 21 Jun 2021 09:26:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxH6l/hNM6iARzt9Teyk8mJiunYZSJe8TnhmuQ79Ki4yuG8AdqaVbc3iPK+D9+cE5fegrrr X-Received: by 2002:a02:908a:: with SMTP id x10mr18058627jaf.30.1624292805025; Mon, 21 Jun 2021 09:26:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624292805; cv=none; d=google.com; s=arc-20160816; b=Tvdou6DT8iNGyO1RTzB42fzVII54Ben9wHqmn5/60X13ML09a4pQmqXo3z6g8GbXZ+ 7etuKlfoD571SxOz63XwwHFefxHoPV+GDzjz0mV4chRVV0juw0VJ7GJHO7UoW7w1y7b3 E1TZMqlIRbZPQ/nXDcTzi3CFCmJxCNScBotIWBVyI1X4t6NdeuY1qByuIPFL7R0eReIM mwGDJ+a6txzpujl7N89/zfroEyGEGQ+N9Jyneb+v4Xcko9GwVEDnIQu/rkNxdbuy+hmA zxFdt3SCqZio8K+49kWEH8xmZY0p/VM7OuHCsZ7HQN4MFnPR9lMHJCIU2y7ZgcA3vsay JHuA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=anTxa2fGyu6C5Zxrp+Odwv4AR2hchOhdIIOVkXADvIM=; b=hbIKZqxOYx1U9d8rvfHNaewyGqEvTQo8hBchuMtQHyZ4TGhKra2i2RSV1NwabX+hok NWYdGwqF8jBDmZqVyZQTB+Ws4u9J0IglECV3rOJWmhlHXZ/cMP9E23/wgsGJ5ooNHHNd tsfVmbFQ9Q8hoOFxaBx2T3nX3YEPltNbHYJ4EzVJrktB3ZwieDZLHP1fOLLf0PD2QaXb CrEXOMGWxzcAlz76GqGUEkHQnBQ7cJWQ+y7evl8fyRiVoMmYiZQJQ7NA0PxYa+zHYz2I VfPeG7m+c59T3KBGwYSHcKp/lQ8SIUk1BSjAErq7xnK1VT2pa/pTZjXfmWuSEq12qANU zlCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="R26EW/SA"; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a8si15716614jat.11.2021.06.21.09.26.30; Mon, 21 Jun 2021 09:26:45 -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=@linuxfoundation.org header.s=korg header.b="R26EW/SA"; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231229AbhFUQ1Q (ORCPT + 99 others); Mon, 21 Jun 2021 12:27:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:47296 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231235AbhFUQZW (ORCPT ); Mon, 21 Jun 2021 12:25:22 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7C02F6135D; Mon, 21 Jun 2021 16:21:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1624292508; bh=JbuhIyJAfer9NYMXoCW3Mmlkoj5LbRexQF9JMmMicYU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R26EW/SA63Kq6CpmyOIFAKaybWbzy9nhwxQP4sRKK9sOYoZD9r5KffY8eiCW9apJr yJ9FZTZh5iIg3GyblvEfugpARHwbuiivzby59YAi9eHQKlW3sutnwPmeU7tOKyDYQ3 Z8oClOHlfOnAz0dVmIcYKfLZX3L+FMPF7UGZWQ+c= 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" , Sasha Levin Subject: [PATCH 5.10 026/146] rtnetlink: Fix regression in bridge VLAN configuration Date: Mon, 21 Jun 2021 18:14:16 +0200 Message-Id: <20210621154912.160944460@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210621154911.244649123@linuxfoundation.org> References: <20210621154911.244649123@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 83894723ebee..dd4659246405 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -4842,10 +4842,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