Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp331791ybi; Wed, 29 May 2019 22:28:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqx/vgLaw4XCfdXkyLfMmv6jO570UQ1tkLeBLlArWMWENOFy9U7X5fhuFAfgg/FQYytDA9wV X-Received: by 2002:aa7:8598:: with SMTP id w24mr1894537pfn.160.1559194104662; Wed, 29 May 2019 22:28:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559194104; cv=none; d=google.com; s=arc-20160816; b=t3nW1ZB1K0+B2bnZS+rHI8jvo2IdqdD/ZDWGTj7pjc1XHq65m1izRSlq8J+XSS5wOM tBaZpgFhdUVwTxqZXxj52LuIIxDzP45CwCuxr02QYigSakMRiFVcJe60CjV+fiZBsK5c XVpX7qFE+OcKAm/KtmJNGSxL1iZlzKnTPARM8vFBR4GfuQqpU5ORiFGLJLXTR3ptv0Cv 9/hEJUli36BBtgFwh5Fw8hSP6sCKWC8tAlAsluetSDh1Iln6GvbYAYOuTGkL4rNcnv6C 8WUXwnsWqT7+z2YVFq2Te0ynuCVLz7xz6AiPzlG51Jyp2sZ1j6IshSMvdfVYuY5jP2M/ GPpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date; bh=Q4NqNZ8I2HvK4PaYmK4PBxTXwLpPCX60IV6Mi9g5gBo=; b=CTFY7Tr+fs+7nqKqQS9kC8rL1jKDI2kbX8WWq73n85rf7u045Lcj/9N17h45rpLTC9 MeIpXG1dvl/HGFrR69PN0btYUckm6C88mKXwsTFmWo3p3UOdguQIxqRO0BHf16TJqk55 j47WRneh81tneErR82gZeVnN8w7s+A+hMy+APBuKvZRUiK/z2tyPmq/Acfa+3f/8q30H O+0li6m+cpEdmtObYR3Unh1h54XJP6jdPJYfIVODUBLITvJf2V60uEFAf0H88k+eKaWJ 0A7DzbtnMMb1KBioroIMCD6fY6FVpLMVqkZu1r5yC1LYKuu9hN7Vrw8SYnFdNHfDI8I1 T3Bg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h63si1659321pfb.90.2019.05.29.22.28.08; Wed, 29 May 2019 22:28:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726806AbfE3FRq (ORCPT + 99 others); Thu, 30 May 2019 01:17:46 -0400 Received: from shards.monkeyblade.net ([23.128.96.9]:47074 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725961AbfE3FRq (ORCPT ); Thu, 30 May 2019 01:17:46 -0400 Received: from localhost (unknown [IPv6:2601:601:9f80:35cd::3d5]) (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 3E9E813E2C2F6; Wed, 29 May 2019 22:17:45 -0700 (PDT) Date: Wed, 29 May 2019 22:17:44 -0700 (PDT) Message-Id: <20190529.221744.1136074795446305909.davem@davemloft.net> To: vivien.didelot@gmail.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@savoirfairelinux.com, linville@redhat.com, f.fainelli@gmail.com Subject: Re: [PATCH net-next] ethtool: copy reglen to userspace From: David Miller In-Reply-To: <20190528205848.21208-1-vivien.didelot@gmail.com> References: <20190528205848.21208-1-vivien.didelot@gmail.com> X-Mailer: Mew version 6.8 on Emacs 26.1 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, 29 May 2019 22:17:45 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vivien Didelot Date: Tue, 28 May 2019 16:58:48 -0400 > ethtool_get_regs() allocates a buffer of size reglen obtained from > ops->get_regs_len(), thus only this value must be used when copying > the buffer back to userspace. Also no need to check regbuf twice. > > Signed-off-by: Vivien Didelot Hmmm, can't regs.len be modified by the driver potentially?