Re: [PATCH] dax: explain how read(2)/write(2) addresses are validated

From: Ross Zwisler
Date: Thu Aug 17 2017 - 11:21:00 EST


On Thu, Aug 17, 2017 at 10:53:32AM +0200, Jan Kara wrote:
> On Wed 16-08-17 11:36:15, Ross Zwisler wrote:
> > Add a comment explaining how the user addresses provided to read(2) and
> > write(2) are validated in the DAX I/O path. We call dax_copy_from_iter()
> > or copy_to_iter() on these without calling access_ok() first in the DAX
> > code, and there was a concern that the user might be able to read/write to
> > arbitrary kernel addresses with this path.
> >
> > Signed-off-by: Ross Zwisler <ross.zwisler@xxxxxxxxxxxxxxx>
>
> Looks OK to me so feel free to add:
>
> Reviewed-by: Jan Kara <jack@xxxxxxx>
>
> Just I'd note that standard buffered read / write path is no different so I
> don't see a big point in adding this comment when it is not in any other
> path either...

Fair enough. Yea, if it's not in any of the other paths either and it's just
common knowledge that these addresses are validated at the VFS layer, we can
leave it out.