Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2363766rwd; Mon, 15 May 2023 10:34:12 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4g1M5AVba1Tlzmdq9LLnQT+54n+1cdIq0822bMu06wZj4GnZoePOM0+HPlR2o+ee3SB7Lk X-Received: by 2002:a05:6a20:a10c:b0:f4:d4a8:9c84 with SMTP id q12-20020a056a20a10c00b000f4d4a89c84mr41116130pzk.32.1684172052346; Mon, 15 May 2023 10:34:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684172052; cv=none; d=google.com; s=arc-20160816; b=o7yhCmanii+ELA3/htM+ZNIbmpeMPAUYatfsil3XaoxhVg1UIZ/z5hcSCJRlphVSMm iYwcabcYjrNmvr51TEFZ++ov0jkrNrnUXFrQ080V4q94URzRMAAMAcJfYC3fjEGpKN8R oqQYnmj2M9c0ab7yC4J584hyPbgKKG/aF4c23GCwTLfietzt46Mtfrm2PGLsc5VnPN+T 4TCzMcWl0G4N3OLAnQUOgDzjUuLwL3ndIGpPBTpB8D/rwUU3G+L6da3dBce2OO2n/f1s XBpW48CFGsuspgdqaPmBB7BRGe48RdBJudQzVAar+9E4I0b/em7sK2b4Y3JsR19h9Dwu 0BQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=tjbWYtWJTtOAaFL/DfgU+hQjnAxrNeVxu1yjJPXsji8=; b=dCTwjRHf42EKWigr8z/LDkNsZE6+5vLhAbExZwIYH1zXefbRvF1n1AE52OYtEFFsXQ pTXCx5/3dkC862KniiD94t/06qU3sx/yl8F1ZX6Xl6nClWy6z1894b/cW0AgybzUwBCt kWEd1x0m1QN1PVAQfzLV8vfVALVjmIkAd2B0jWvIjqKav9lD/OLurji59s1k3XomKHPt lL1LxvC+HHA3S1+7is6dml8ieHp1mTGmWvHHd4ysT2DBeM72nrW3jGLMchEVHiCIeB7/ fR6zFh7GDKqVAgLStd1G0i6aXjDOvzQLQICDgy3Xy4Y79FxJvYyogcNP9z0okYZ8/L9p /TQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=tdjxYzeK; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n7-20020a6543c7000000b005308d2418fasi9350135pgp.753.2023.05.15.10.33.58; Mon, 15 May 2023 10:34:12 -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=@wanadoo.fr header.s=t20230301 header.b=tdjxYzeK; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243866AbjEORRr (ORCPT + 99 others); Mon, 15 May 2023 13:17:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243672AbjEORRb (ORCPT ); Mon, 15 May 2023 13:17:31 -0400 Received: from smtp.smtpout.orange.fr (smtp-21.smtpout.orange.fr [80.12.242.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11D4E11D95 for ; Mon, 15 May 2023 10:15:57 -0700 (PDT) Received: from [192.168.1.18] ([86.243.2.178]) by smtp.orange.fr with ESMTPA id ybnepdN4B4Eobybnepjxfr; Mon, 15 May 2023 19:15:56 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1684170956; bh=tjbWYtWJTtOAaFL/DfgU+hQjnAxrNeVxu1yjJPXsji8=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=tdjxYzeKEs5N49Wh/DT0gtNIgwI3NoV4rB9kOjf/rcT5TtCzIUHJ3Z7CB5dQzmSy6 Stfu7Vvg6/aDOKuEC7/jnjDx5pQdwYcsx37HAZEL4rPmfDEX+xu0B+cv578OLynGOL Le3H6q9w0WpgcMcIDhpBgU7tfT0nGc/xh9xQ2Y0IBMRrPvrF4ekv5hhmpD9te2u0uD ZbFbKGvnJt/uZZyoFsEjkmi5ygj5eEXqbGQsBsd15MvWDRga65qKpkPoiXfPwJrZHa 3D37SKLTYhUZyzPYOhzUnrfyIQztZgtepG+q/J8ax6VmCjS24LItxLOSO/ky7zLL5G 8QHL6oBWp7eIA== X-ME-Helo: [192.168.1.18] X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Mon, 15 May 2023 19:15:56 +0200 X-ME-IP: 86.243.2.178 Message-ID: <5359488e-2b37-b328-3dbc-00bedd1726d5@wanadoo.fr> Date: Mon, 15 May 2023 19:15:54 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH] coda: return -EFAULT if copy fails To: Su Hui , Jan Harkes , coda@cs.cmu.edu Cc: codalist@coda.cs.cmu.edu, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org References: <20230515061923.767680-1-suhui@nfschina.com> Content-Language: fr From: Christophe JAILLET In-Reply-To: <20230515061923.767680-1-suhui@nfschina.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,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 Le 15/05/2023 à 08:19, Su Hui a écrit : > The copy_to/from_user() functions should return -EFAULT instead of -EINVAL. Hi, just for my understanding, why? Even if not perfect: git grep -A1 copy_from_user | grep EINV | wc -l 15 git grep -A1 copy_to_user | grep EINV | wc -l 12 CJ > > Signed-off-by: Su Hui > --- > fs/coda/upcall.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/coda/upcall.c b/fs/coda/upcall.c > index cd6a3721f6f6..1517dc3bd592 100644 > --- a/fs/coda/upcall.c > +++ b/fs/coda/upcall.c > @@ -510,7 +510,7 @@ int venus_pioctl(struct super_block *sb, struct CodaFid *fid, > /* get the data out of user space */ > if (copy_from_user((char *)inp + (long)inp->coda_ioctl.data, > data->vi.in, data->vi.in_size)) { > - error = -EINVAL; > + error = -EFAULT; > goto exit; > } >