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=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,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 D2E99C7659C for ; Thu, 27 Feb 2020 14:36:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9CE9224656 for ; Thu, 27 Feb 2020 14:36:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582814166; bh=UNjkvXfQWWXq/yhRlv52KlW+Vqgo0EflO9SgIZ6VtPg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=iwDrYxw1JAgbdm+VumzYH+2SCLvGAfi/GJNJ4S3wCM6jBTHAy4S4+HvjYAaWFSuqu 5SBE6v3VpTbVj/kIB2FpeprWcY4yMMscGyJkeVUeBfxWWKMv0NVFrkZdWkFf/Xkiq1 FoRPXXWm81qkT+BguLfLGl0cxx35VI8RMCYn2PFo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732609AbgB0N7b (ORCPT ); Thu, 27 Feb 2020 08:59:31 -0500 Received: from mail.kernel.org ([198.145.29.99]:60748 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727998AbgB0N7W (ORCPT ); Thu, 27 Feb 2020 08:59:22 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 78E6820801; Thu, 27 Feb 2020 13:59:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582811960; bh=UNjkvXfQWWXq/yhRlv52KlW+Vqgo0EflO9SgIZ6VtPg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NBgidTsWBarGk8ubo7gxGQD9Ppb16gEj6Pv+Wq9nzl+4iXIOulRo2ZvW85XUvEFMd n9GnQFF9u9AG1b1h+0i+sYu4pvntAKGig7vl6AopZ4SWYafyFEgBraoQQHirfILueG k4+fiduBVmGqOjQJQaMemNtjKaC+Q5aMePICMQU8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Davide Caratti , Jiri Pirko , "David S. Miller" Subject: [PATCH 4.14 169/237] net/sched: matchall: add missing validation of TCA_MATCHALL_FLAGS Date: Thu, 27 Feb 2020 14:36:23 +0100 Message-Id: <20200227132308.883193159@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200227132255.285644406@linuxfoundation.org> References: <20200227132255.285644406@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Davide Caratti [ Upstream commit 1afa3cc90f8fb745c777884d79eaa1001d6927a6 ] unlike other classifiers that can be offloaded (i.e. users can set flags like 'skip_hw' and 'skip_sw'), 'cls_matchall' doesn't validate the size of netlink attribute 'TCA_MATCHALL_FLAGS' provided by user: add a proper entry to mall_policy. Fixes: b87f7936a932 ("net/sched: Add match-all classifier hw offloading.") Signed-off-by: Davide Caratti Acked-by: Jiri Pirko Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/sched/cls_matchall.c | 1 + 1 file changed, 1 insertion(+) --- a/net/sched/cls_matchall.c +++ b/net/sched/cls_matchall.c @@ -136,6 +136,7 @@ static void *mall_get(struct tcf_proto * static const struct nla_policy mall_policy[TCA_MATCHALL_MAX + 1] = { [TCA_MATCHALL_UNSPEC] = { .type = NLA_UNSPEC }, [TCA_MATCHALL_CLASSID] = { .type = NLA_U32 }, + [TCA_MATCHALL_FLAGS] = { .type = NLA_U32 }, }; static int mall_set_parms(struct net *net, struct tcf_proto *tp,