lkml.org 
[lkml]   [2022]   [May]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] random: convert to using fops->read_iter()
Hi Al,

On Fri, May 20, 2022 at 03:11:06AM +0000, Al Viro wrote:
> > SYSCALL_DEFINE3(getrandom, char __user *, ubuf, size_t, len,
> > unsigned int, flags) { + struct iovec iov = { .iov_base = ubuf };
> > + struct iov_iter iter;
>
> import_single_range(READ, ubuf, len, &iov, &iter)
>
> (note, BTW, that this'll cap len)

I'll incorporate this and send a v4. import_single_range does an
access_ok(), but I would hope that copy_to_iter() also does similar
checks. Does that make this less efficient?

Jason

\
 
 \ /
  Last update: 2022-05-20 11:16    [W:0.608 / U:1.800 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site