Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4715434rwd; Sun, 4 Jun 2023 11:03:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6DCbOK7jTmqKy7apNuiPcBiMyc5H2S3DCYzwRrjAnm2jxnIF6R5s37Z4qwass8Aq4Ijglf X-Received: by 2002:a17:90a:8a91:b0:256:b190:2733 with SMTP id x17-20020a17090a8a9100b00256b1902733mr2690810pjn.33.1685901802943; Sun, 04 Jun 2023 11:03:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685901802; cv=none; d=google.com; s=arc-20160816; b=ml8NaQ6N4t7zx8bRRD4OarjCuX+rOwVVcvTMoSohjJzI3RPIske88u/qLI9z/PJZPo VGWp2YXva6Fo8V44NE9lLGs4cvQQ6/SYEknM7uG711+3xguZUK39LFHgSvu7YciW+8r4 VzgDGkf1JqYSqUa61Yjse24mAd5qDFIq4inP4Xdr9Hsuwg4mHv7FFQ/vuQMd/YaQmIeH DxipnQEw5RwX1KQUTzKMYTIFdjr+VdIPMS+GVSXZhLie8wgevn9huPWi+K0ugXaRt4lb ZzIvSdhLmIYwlyqxYIZPRN9XQFAJbOzUcrnbohme+lhx70jTYkPbJ4eNOAidS3/RDh9E dUhg== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=0BmKu00cG704+EexNuBr+pifRQ4f6yVy6LT3rzlr6Xc=; b=chrgnHNKmrUBHLFbWyo455U8uUh6k0f91cw0/AV+DMFVsKjeRwrsR7AsYyZwK4mkQ/ m+0wuLiB2czF9jIEHcGcbFxE73xIvjcSLZpewdsAzFLuecxTusKyxcnzSiD+3xp3fDLa 8zxA2vFFxijpsvm18+v7DGmf2seLjsJFcI27q/J6S4KxJ/kbO9kdcV+d8xW0zf2twBXd LAhA6BnjAW2CsmUt7frUULNmp1gHJwEWEwQX6eAQlugjklBaeyXY2ZM586Z5a/bUq17P O3EjUtbEk5Vp/KfCkOTtHqoiyUm6n8QW27OhmpzqejkapIQB/MHqXS0pvsxDAhxtWXlu P5eA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bssiVLw+; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oc1-20020a17090b1c0100b0025690b76c95si4640898pjb.10.2023.06.04.11.03.10; Sun, 04 Jun 2023 11:03:22 -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=@kernel.org header.s=k20201202 header.b=bssiVLw+; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231701AbjFDRrY (ORCPT + 99 others); Sun, 4 Jun 2023 13:47:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229449AbjFDRrW (ORCPT ); Sun, 4 Jun 2023 13:47:22 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C68AAF for ; Sun, 4 Jun 2023 10:47:21 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D573C60FF5 for ; Sun, 4 Jun 2023 17:47:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CF716C433D2; Sun, 4 Jun 2023 17:47:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685900840; bh=L/YT96vOzfrD5Zbb2hKA+7cau17vtyz43WIU+qXB61k=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=bssiVLw+CmolrmdLynpKWU7Hg2h5P9/4yphu+aZQP8yn6Z9CRv+oC8r3PIYuhyj+w kAwhaQeHgR9wBGGop1rzGFdh24x/OooN3lxpucq1CJ7rrFN+yMlGypkzbyYcX0lBZn AVhrvpNU0Aua6anhLhanMt6XlQ672pqyW+65BOlXEl6thV8Ca+UYJtjEYYTXYnhgPT H1Ku3dFaAjEMgcdOlZ42pJ+XTzVWGbh+FTThhW1ABtwQWIpVctMktHrqFFw+//HFWe 5oKpWGndOoFu8IjYFESL0zgEW6Hk3QVYFXRUniNsfLosQKoHLz0fsUN+Po10SUJvmF M7RjP2hoev/Hg== Date: Sun, 4 Jun 2023 10:47:18 -0700 From: Jakub Kicinski To: Ding Hui Cc: Alexander Duyck , Andrew Lunn , davem@davemloft.net, edumazet@google.com, 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: <20230604104718.4bf45faf@kernel.org> In-Reply-To: <5f0f2bab-ae36-8b13-2c6d-c69c6ff4a43f@sangfor.com.cn> 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> <44905acd-3ac4-cfe5-5e91-d182c1959407@sangfor.com.cn> <20230602225519.66c2c987@kernel.org> <5f0f2bab-ae36-8b13-2c6d-c69c6ff4a43f@sangfor.com.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On Sat, 3 Jun 2023 15:11:29 +0800 Ding Hui wrote: > Yes. > > I checked the others ioctl (e.g. ethtool_get_eeprom(), ethtool_get_features()), > and searched the git log of ethtool utility, so I think that is an implicit > rule and the check is missed in kernel where the patch involves. > > Without this rule, we cannot guarantee the safety of copy to user. > > Should we keep to be compatible with that incorrect userspace usage? If such incorrect user space exists we do, if it doesn't we don't. Problem is that we don't know what exists out there. Maybe we can add a pr_err_once() complaining about bad usage for now and see if anyone reports back that they are hitting it?