[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHmME9qZ4HjG_qL2qb=bUn95rUmd_F8bUnzD=Ht2MMAjuH0CFg@mail.gmail.com>
Date: Fri, 8 Apr 2022 12:33:47 +0200
From: "Jason A. Donenfeld" <Jason@...c4.com>
To: David Laight <David.Laight@...lab.com>
Cc: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"torvalds@...ux-foundation.org" <torvalds@...ux-foundation.org>,
"tytso@....edu" <tytso@....edu>,
"sultan@...neltoast.com" <sultan@...neltoast.com>,
Jann Horn <jannh@...gle.com>
Subject: Re: [PATCH v2] random: allow partial reads if later user copies fail
Hi David,
On 4/8/22, David Laight <David.Laight@...lab.com> wrote:
> From: Jason A. Donenfeld
>> Sent: 08 April 2022 00:36
>>
>> Rather than failing entirely if a copy_to_user() fails at some point,
>> instead we should return a partial read for the amount that succeeded
>> prior, unless none succeeded at all, in which case we return -EFAULT as
>> before.
>
> I think you now return -EFAULT for a zero length read.
The diff context doesn't show it, but the first line of the function
is `if (!nbytes) return 0;`, before various other bits of work are
done.
Jason
Powered by blists - more mailing lists