]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - fs/dax.c
dax: explain how read(2)/write(2) addresses are validated
[mirror_ubuntu-bionic-kernel.git] / fs / dax.c
index c576f6181dc8958951669fd6f91d2d18177874c7..5b2eac3ef077db86c8e916abae92e14d084eefd1 100644 (file)
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -1004,6 +1004,11 @@ dax_iomap_actor(struct inode *inode, loff_t pos, loff_t length, void *data,
                if (map_len > end - pos)
                        map_len = end - pos;
 
+               /*
+                * The userspace address for the memory copy has already been
+                * validated via access_ok() in either vfs_read() or
+                * vfs_write(), depending on which operation we are doing.
+                */
                if (iov_iter_rw(iter) == WRITE)
                        map_len = dax_copy_from_iter(dax_dev, pgoff, kaddr,
                                        map_len, iter);