Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2874725pxu; Sat, 19 Dec 2020 05:01:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJzZTf/uB2nk10YYrf/QaZpYAp7bLZGxXCu6GbZAV1Z03ns4jEErEYwYN48hUgwRILir79T2 X-Received: by 2002:aa7:d3cc:: with SMTP id o12mr9062948edr.235.1608382904232; Sat, 19 Dec 2020 05:01:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608382904; cv=none; d=google.com; s=arc-20160816; b=Bjbl5oJ00QTDygqz4axtTh7E8F2/0mElvpn0/kLqYLi7zBJFGLhRZgWy3VDXjv0/sy /Zgm+UWZ+RElBLj9HNlBJ+zVvqNQDQcZhYxFpGwCKN0qWeOC2blsA7G6ggAZBOiUr+HK UbEAFXScHsxFvgbwMm3OflZmZs9Yq24nmdgNpnFRmwFtzSajlGvEC2hTWezva4DZzUzw 1haipAuepQKCVomgB00otyU1XzUa55O9N+VFqlZcjWtROdBnPixVnt/KnwJabunAbdpO X/Japxr59qtBpL6f+lUYL+M/q/EvdOZFbqhFCvVzzy1e5Lgubi8Hq9mxHXzhYxGQv/z3 QPLw== 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; bh=RLu7i7emM444YMGv4jJth8W98nlKtDFCMpTgw6uMIQ8=; b=zgdG9uyNRk1tuUi1B6Cw/oV3i+GqpLAmuIVhdZlAfCf9xUndcGMD/CcMF9i3UENkdU PMtXOThg66L6g7HjHAi/fXXI0QeocxKMsknKB59O4ws3Qg7zvVlvPsZMfLqT8vLqSvYb YuhUnWtuRTLSODtEHrOneGpcHWW8F5CKpBBw1anWHOKvYpFF4/OVogiMB+DoEH3gg0TG bVerJdrl45e6TErskaTqT+9itCVi4JOPS9g7t5i8r21t+GPlOt3UnzfZDfBfu1GywxzB NCPQ0l+pwXqvlWg2qrZWojvn/BkRHUxIjAMeRGsuCuxxpLY6W7uK8D9QDCeoNC5rI7tC 28FA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (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 t21si7856248edq.546.2020.12.19.05.01.21; Sat, 19 Dec 2020 05:01:44 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728279AbgLSM7j (ORCPT + 99 others); Sat, 19 Dec 2020 07:59:39 -0500 Received: from mail.kernel.org ([198.145.29.99]:45232 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728013AbgLSM7L (ORCPT ); Sat, 19 Dec 2020 07:59:11 -0500 From: Greg Kroah-Hartman Authentication-Results: mail.kernel.org; dkim=permerror (bad message/signature format) To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Guillaume Nault , "David S. Miller" Subject: [PATCH 5.9 27/49] net: sched: Fix dump of MPLS_OPT_LSE_LABEL attribute in cls_flower Date: Sat, 19 Dec 2020 13:58:31 +0100 Message-Id: <20201219125346.007154943@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201219125344.671832095@linuxfoundation.org> References: <20201219125344.671832095@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: Guillaume Nault [ Upstream commit 7fdd375e383097a785bb65c66802e468f398bf82 ] TCA_FLOWER_KEY_MPLS_OPT_LSE_LABEL is a u32 attribute (MPLS label is 20 bits long). Fixes the following bug: $ tc filter add dev ethX ingress protocol mpls_uc \ flower mpls lse depth 2 label 256 \ action drop $ tc filter show dev ethX ingress filter protocol mpls_uc pref 49152 flower chain 0 filter protocol mpls_uc pref 49152 flower chain 0 handle 0x1 eth_type 8847 mpls lse depth 2 label 0 <-- invalid label 0, should be 256 ... Fixes: 61aec25a6db5 ("cls_flower: Support filtering on multiple MPLS Label Stack Entries") Signed-off-by: Guillaume Nault Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/sched/cls_flower.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/net/sched/cls_flower.c +++ b/net/sched/cls_flower.c @@ -2424,8 +2424,8 @@ static int fl_dump_key_mpls_opt_lse(stru return err; } if (lse_mask->mpls_label) { - err = nla_put_u8(skb, TCA_FLOWER_KEY_MPLS_OPT_LSE_LABEL, - lse_key->mpls_label); + err = nla_put_u32(skb, TCA_FLOWER_KEY_MPLS_OPT_LSE_LABEL, + lse_key->mpls_label); if (err) return err; }