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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B3DBFC433EF for ; Fri, 11 Mar 2022 07:00:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=gyeK7tgXGzEDkpT3z0yfKdQ/ZLDaSpHUH+M/WA0I/x8=; b=dYMgng+xlyxViWQbne7uuihKFO n5/GrnSi37+OPwGBkZM4Hn6Jg+tSHrAW4lcG8qcXfubc/ImIXspST0OhWyE0oqW6ScA2aCJPKBtqq AtEuqX0EfAaSolarJ7MB5/FJyZZeNuBsSWVLfD6HrStrsyFyvm4v1VBfAl6h7GsrUGELhLIbIZJTG DsXLuXkSqVSF0ySMlQxHwLk21Tyfhe+z18bsDMAFCKRwt4zTPhfsWc64fy4ui2s40eyZm3COV3aAd 91HMsMgceHa5Q1zCJIu9eOnmIUvYlZ8uoXRtkX6fzwWk7KoejxUJYZJX9D/Gd8g2H6BbqKW4F9Q5b oAcJe0DA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nSZEo-00FHtN-5w; Fri, 11 Mar 2022 06:58:58 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nSZEk-00FHsh-Q7 for linux-arm-kernel@lists.infradead.org; Fri, 11 Mar 2022 06:58:56 +0000 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 C198761D48; Fri, 11 Mar 2022 06:58:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 808ECC340E9; Fri, 11 Mar 2022 06:58:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1646981933; bh=57QZ3z3TEDeIuuizUKu4lfq1+BF92zuxMI5WApqedIc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=E/bqfdCeMyOPzV6SS9ZruCs09qR+6vq8r1D1pyHSqRBRr9HN+JA6/AWG8pEfA2uKT 3otvhvpBZf0OG3sUzODx2C7OLX18Ni/nq3XHNUMM3y/q9GXdQ2Au3AbdzuiE9e+ko6 dCQIX8fa8v69mNfE71hxT3B1GxLH9tn0m6/F3RbYlZThnGObIz8umKrsLKGCqU3udv kMIdklBvY1wg+Gf3ZqMZx/ia9FvEtvmv+9gG1/Darl2KwHsF3N3QG/6JmetdYqpUAl ApnoeX9PXhnBfGMbeLB8jv/k2Th3dJdggjwGT24HDrsYrQKtUiHvygPJuVhzhhU+0S rgZa5ome2AaRQ== Date: Fri, 11 Mar 2022 07:58:46 +0100 From: Wolfram Sang To: Quan Nguyen Cc: Corey Minyard , Rob Herring , Krzysztof Kozlowski , Joel Stanley , Andrew Jeffery , Brendan Higgins , Benjamin Herrenschmidt , openipmi-developer@lists.sourceforge.net, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, openbmc@lists.ozlabs.org, Open Source Submission , Phong Vo , "Thang Q . Nguyen" Subject: Re: [PATCH v6 3/4] ipmi: ssif_bmc: Return -EFAULT if copy_from_user() fails Message-ID: Mail-Followup-To: Wolfram Sang , Quan Nguyen , Corey Minyard , Rob Herring , Krzysztof Kozlowski , Joel Stanley , Andrew Jeffery , Brendan Higgins , Benjamin Herrenschmidt , openipmi-developer@lists.sourceforge.net, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, openbmc@lists.ozlabs.org, Open Source Submission , Phong Vo , "Thang Q . Nguyen" References: <20220310114119.13736-1-quan@os.amperecomputing.com> <20220310114119.13736-4-quan@os.amperecomputing.com> MIME-Version: 1.0 In-Reply-To: <20220310114119.13736-4-quan@os.amperecomputing.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220310_225854_969662_1074E404 X-CRM114-Status: GOOD ( 22.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============5283993159414583184==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============5283993159414583184== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="c+D6WiTH4AhpNkI6" Content-Disposition: inline --c+D6WiTH4AhpNkI6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Mar 10, 2022 at 06:41:18PM +0700, Quan Nguyen wrote: > From: Dan Carpenter >=20 > The copy_from_user() function returns the number of bytes remaining to > be copied but we should return -EFAULT here. >=20 > Fixes: 501c25b59508 ("ipmi: ssif_bmc: Add SSIF BMC driver") > Signed-off-by: Dan Carpenter > Signed-off-by: Corey Minyard > Signed-off-by: Quan Nguyen It is nice that you want to keep this patch seperate to give Dan credits, but I still think it should be merged into patch 1, so the initial driver is as flawless as it can be. You could give Dan still credits by mentioning him in the commit message IMO. Dan, would you be fine with this? > v6: > + New add in v6, thanks Dan for the patch [Dan] >=20 > drivers/char/ipmi/ssif_bmc.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) >=20 > diff --git a/drivers/char/ipmi/ssif_bmc.c b/drivers/char/ipmi/ssif_bmc.c > index 62db97773654..91ac2cae756e 100644 > --- a/drivers/char/ipmi/ssif_bmc.c > +++ b/drivers/char/ipmi/ssif_bmc.c > @@ -87,9 +87,8 @@ static ssize_t ssif_bmc_write(struct file *file, const = char __user *buf, size_t > if (count > sizeof(struct ssif_msg)) > return -EINVAL; > =20 > - ret =3D copy_from_user(&msg, buf, count); > - if (ret) > - return ret; > + if (copy_from_user(&msg, buf, count)) > + return -EFAULT; > =20 > if (!msg.len || count < ssif_msg_len(&msg)) > return -EINVAL; > --=20 > 2.35.1 >=20 --c+D6WiTH4AhpNkI6 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAmIq8yIACgkQFA3kzBSg KbZEgBAAiUx2Df2QUChkO0IP8Cx64ymzUxiS8tVADYlH1t77TAN/0RmIWSkUXD4U eHPAqnUOUcScJqidUpOhNT8v/4JKeW2/SSw7NpJyDL3n9BqddH+3QRDVDxuvT7ga I9pVMmEPoU5PjSOfWyzfMzbJhs99UwcFtkqOvZRUSQsoUxWsVoPCs6Aknwstz6DD bmfDpwJxNKRadqLA/bO6uQcpxUvCQM4hIq/zKMWnF8Yqsxg8Rr4raQJFGj0VIcp9 Zd4WIs4ZauwTu0RGbOX7++6QslOY6FN0HfVqTuWWGsBF7Z9dep51gC06vFM9+92t lTofulwsmdMNAKKRz2QFAsL9P7fL6pA5sF+qCKJdu3NcYIKm9Ql+nm0UQt9Oq8ZY fJqR6uPYlcv773QThNTSj8dhWCbvGDsxRxGV85DBt3syfohIKt1q4hkD9QsoDlpg bS5SVmVwNxRTRSqWk1Swuf0ARHqF6SHBj6XIR1c/w5FGrTJ7GMHn+KPeUlK4Qr+d az0Sm7lOQCJeW3RnT7c3FMDL3D8vLWt1qvwxBY4IcBQmor4v+5PlMFKxbIYcsnYt vThbUi+zj+XfbVFLdv2+7iOgNM+69pYMfkHfH7tnyhoCPeo5VCtH6urycWRx1Zlb CkfWmKciuaVVasw5wHT8svjZqVqKFqkfecbL29RMHbkim4743Q0= =s5hT -----END PGP SIGNATURE----- --c+D6WiTH4AhpNkI6-- --===============5283993159414583184== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============5283993159414583184==--