Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2481623rwd; Fri, 2 Jun 2023 10:00:25 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7ZmnKjQ/Ir9dbRAIRUpwLtsYS/9wIefK/00nlo1B0EyR9SPUTs2JCv7ZOjqu8PXL3fJY/D X-Received: by 2002:a17:90a:fd0c:b0:24d:e296:659b with SMTP id cv12-20020a17090afd0c00b0024de296659bmr62290pjb.22.1685725224909; Fri, 02 Jun 2023 10:00:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685725224; cv=none; d=google.com; s=arc-20160816; b=CrwH3jKgFpr3ONRYEwXsUNSx36ljPtsPpy6LaGn5gR/QZvTX4kCfnswc16ka/uOF3G 7qbTj+2zL63Zg3ugtztPtXULF/OuPh42LdELPyOvUKInAX/kPZl9wrXv/hmm+Y3N+z8w 06n63P5I/i8Px8ggHBkxMMIQSl5oVc8Py3KREw98FhlYnyJPIa8R7BUUDqtC1ukcMcaX add2KxhWt/uIy1olmrmr1ul/XoQCYi3GVu5FRsDNZC6Jsm2OBW3HMnRdW7gT5tyn59sR OJk3tWPOT8ChLMxCNacPNKIUpfDNLGFHUSw6icQeYzK3uWHoTKgIt6aW7+0kKFCbb/MP z+TA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=JsYlrvA25bkNo5kQtABR+rHsTJbpCtqCFosVc6Tty7w=; b=wlKyDmR+S2R0acKjA21SOvtrrE7kGeCanhhy2T7aEVS6FgUn6HK98hEjIUaOfPa/aa s7IWvvijEysC/LkoHnQRQjVMtNz8qCdrQqO7xUKwjXdOLDCIK8DSVQqwzHGdrTwF+wFL 4xLcw5VqGfE9/IZZW5K/EsdjywE34FgGR5TM53pbDlK6ffa894wPB5QwRneJH5LYK7uA Po4omDEQirBOhT+xGgBco/ubUj+H6iwpRJnlmgcDVETd8mp2H+cAGOY2BiY+cM22sOTg FYpN2L0yUDkdZeW0/4jGdXnBmt8H4mDShr2HukjEZFc/mReEOXj83T+r+h1H9x/smFVd zOGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=mFr3ZmKg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nh2-20020a17090b364200b002562c9b3e2dsi2973372pjb.96.2023.06.02.10.00.12; Fri, 02 Jun 2023 10:00:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=mFr3ZmKg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235195AbjFBQhV (ORCPT + 99 others); Fri, 2 Jun 2023 12:37:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235373AbjFBQhT (ORCPT ); Fri, 2 Jun 2023 12:37:19 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C599B4; Fri, 2 Jun 2023 09:37:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=JsYlrvA25bkNo5kQtABR+rHsTJbpCtqCFosVc6Tty7w=; b=mFr3ZmKgZ8QKh4jrNIwpD4cUay +lo3OtKAoD7jI9BPMsJXfrPeewKglRzEnL7WBnqErXKSugPy24gLNAnhwYZsiq11loBapzhtdXBFM Vyzvg/eDb+Ui0OPQUcErF40vaxVf6kJS9tEdiy2zk20abnX+BXkwGFjNdFqcqLimDpms=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1q57m0-00Eh9Z-TU; Fri, 02 Jun 2023 18:37:08 +0200 Date: Fri, 2 Jun 2023 18:37:08 +0200 From: Andrew Lunn To: Alexander Duyck Cc: Ding Hui , davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, pengdonglin@sangfor.com.cn, huangcun@sangfor.com.cn Subject: Re: [PATCH net-next] net: ethtool: Fix out-of-bounds copy to user Message-ID: References: <20230601112839.13799-1-dinghui@sangfor.com.cn> <135a45b2c388fbaf9db4620cb01b95230709b9ac.camel@gmail.com> <6110cf9f-c10e-4b9b-934d-8d202b7f5794@lunn.ch> <6e28cea9-d615-449d-9c68-aa155efc8444@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > What this change is essentially doing is clamping the copied data to > the lesser of the current value versus the value when the userspace > was allocated. However I am wondering now if we shouldn't just update > the size value and return that as some sort of error for the userspace > to potentially reallocate and repeat until it has the right size. I'm not sure we should be putting any effort into the IOCTL interface. It is deprecated. We should fix overrun problems, but i would not change the API. Netlink handles this atomically, and that is the interface tools should be using, not this IOCTL. Andrew