From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Carpenter Date: Thu, 22 Aug 2019 09:41:52 +0000 Subject: Re: [PATCH] netfilter: ipset: Fix an error code in ip_set_sockfn_get() Message-Id: <20190822094152.GJ3964@kadam> List-Id: References: <20190821071830.GI26957@mwanda> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: Kadlecsik =?iso-8859-1?Q?J=F3zsef?= Cc: Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , Florent Fourcot , Kate Stewart , Allison Randal , Aditya Pakki , Qian Cai , Andrey Ryabinin , Johannes Berg , Stefano Brivio , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, kernel-janitors@vger.kernel.org On Thu, Aug 22, 2019 at 11:11:56AM +0200, Kadlecsik J=F3zsef wrote: > Hi Dan, >=20 > On Wed, 21 Aug 2019, Dan Carpenter wrote: >=20 > > The copy_to_user() function returns the number of bytes remaining to be > > copied. In this code, that positive return is checked at the end of the > > function and we return zero/success. What we should do instead is > > return -EFAULT. >=20 > Yes, you are right. There's another usage of copy_to_user() in this=20 > function, could you fix it as well? >=20 Yes, of course. Thanks for the review. regards, dan carpenter