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=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=no 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 2A15CC38A2A for ; Wed, 6 May 2020 21:18:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0F9332075A for ; Wed, 6 May 2020 21:18:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729956AbgEFVSQ (ORCPT ); Wed, 6 May 2020 17:18:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728665AbgEFVSP (ORCPT ); Wed, 6 May 2020 17:18:15 -0400 Received: from shards.monkeyblade.net (shards.monkeyblade.net [IPv6:2620:137:e000::1:9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B332AC061A0F; Wed, 6 May 2020 14:18:15 -0700 (PDT) Received: from localhost (unknown [IPv6:2601:601:9f00:477::d71]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 4E9EC123229ED; Wed, 6 May 2020 14:18:15 -0700 (PDT) Date: Wed, 06 May 2020 14:18:14 -0700 (PDT) Message-Id: <20200506.141814.1060708966400070196.davem@davemloft.net> To: dan.carpenter@oracle.com Cc: maxime.chevallier@bootlin.com, kuba@kernel.org, jiri@mellanox.com, netdev@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH 2/2 net] net: mvpp2: cls: Prevent buffer overflow in mvpp2_ethtool_cls_rule_del() From: David Miller In-Reply-To: <20200506101656.GC77004@mwanda> References: <20200506101622.GB77004@mwanda> <20200506101656.GC77004@mwanda> X-Mailer: Mew version 6.8 on Emacs 26.3 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Wed, 06 May 2020 14:18:15 -0700 (PDT) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Dan Carpenter Date: Wed, 6 May 2020 13:16:56 +0300 > The "info->fs.location" is a u32 that comes from the user via the > ethtool_set_rxnfc() function. We need to check for invalid values to > prevent a buffer overflow. > > I copy and pasted this check from the mvpp2_ethtool_cls_rule_ins() > function. > > Fixes: 90b509b39ac9 ("net: mvpp2: cls: Add Classification offload support") > Signed-off-by: Dan Carpenter Applied. From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Date: Wed, 06 May 2020 21:18:14 +0000 Subject: Re: [PATCH 2/2 net] net: mvpp2: cls: Prevent buffer overflow in mvpp2_ethtool_cls_rule_del() Message-Id: <20200506.141814.1060708966400070196.davem@davemloft.net> List-Id: References: <20200506101622.GB77004@mwanda> <20200506101656.GC77004@mwanda> In-Reply-To: <20200506101656.GC77004@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: dan.carpenter@oracle.com Cc: maxime.chevallier@bootlin.com, kuba@kernel.org, jiri@mellanox.com, netdev@vger.kernel.org, kernel-janitors@vger.kernel.org From: Dan Carpenter Date: Wed, 6 May 2020 13:16:56 +0300 > The "info->fs.location" is a u32 that comes from the user via the > ethtool_set_rxnfc() function. We need to check for invalid values to > prevent a buffer overflow. > > I copy and pasted this check from the mvpp2_ethtool_cls_rule_ins() > function. > > Fixes: 90b509b39ac9 ("net: mvpp2: cls: Add Classification offload support") > Signed-off-by: Dan Carpenter Applied.