#include <linux/export.h>
#include <linux/bvec.h>
#include <linux/fault-inject-usercopy.h>
#include <linux/uio.h>
#include <linux/pagemap.h>
#include <linux/highmem.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/splice.h>
#include <linux/compat.h>
#include <linux/scatterlist.h>
#include <linux/instrumented.h>
#include <linux/iov_iter.h>
static __always_inline
size_t copy_to_user_iter(void __user *iter_to, size_t progress,
size_t len, void *from, void *priv2)
{ … }
static __always_inline
size_t copy_to_user_iter_nofault(void __user *iter_to, size_t progress,
size_t len, void *from, void *priv2)
{ … }
static __always_inline
size_t copy_from_user_iter(void __user *iter_from, size_t progress,
size_t len, void *to, void *priv2)
{ … }
static __always_inline
size_t memcpy_to_iter(void *iter_to, size_t progress,
size_t len, void *from, void *priv2)
{ … }
static __always_inline
size_t memcpy_from_iter(void *iter_from, size_t progress,
size_t len, void *to, void *priv2)
{ … }
size_t fault_in_iov_iter_readable(const struct iov_iter *i, size_t size)
{ … }
EXPORT_SYMBOL(…);
size_t fault_in_iov_iter_writeable(const struct iov_iter *i, size_t size)
{ … }
EXPORT_SYMBOL(…);
void iov_iter_init(struct iov_iter *i, unsigned int direction,
const struct iovec *iov, unsigned long nr_segs,
size_t count)
{ … }
EXPORT_SYMBOL(…);
size_t _copy_to_iter(const void *addr, size_t bytes, struct iov_iter *i)
{ … }
EXPORT_SYMBOL(…);
#ifdef CONFIG_ARCH_HAS_COPY_MC
static __always_inline
size_t copy_to_user_iter_mc(void __user *iter_to, size_t progress,
size_t len, void *from, void *priv2)
{ … }
static __always_inline
size_t memcpy_to_iter_mc(void *iter_to, size_t progress,
size_t len, void *from, void *priv2)
{ … }
size_t _copy_mc_to_iter(const void *addr, size_t bytes, struct iov_iter *i)
{ … }
EXPORT_SYMBOL_GPL(…);
#endif
static __always_inline
size_t __copy_from_iter(void *addr, size_t bytes, struct iov_iter *i)
{ … }
size_t _copy_from_iter(void *addr, size_t bytes, struct iov_iter *i)
{ … }
EXPORT_SYMBOL(…);
static __always_inline
size_t copy_from_user_iter_nocache(void __user *iter_from, size_t progress,
size_t len, void *to, void *priv2)
{ … }
size_t _copy_from_iter_nocache(void *addr, size_t bytes, struct iov_iter *i)
{ … }
EXPORT_SYMBOL(…);
#ifdef CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE
static __always_inline
size_t copy_from_user_iter_flushcache(void __user *iter_from, size_t progress,
size_t len, void *to, void *priv2)
{ … }
static __always_inline
size_t memcpy_from_iter_flushcache(void *iter_from, size_t progress,
size_t len, void *to, void *priv2)
{ … }
size_t _copy_from_iter_flushcache(void *addr, size_t bytes, struct iov_iter *i)
{ … }
EXPORT_SYMBOL_GPL(…);
#endif
static inline bool page_copy_sane(struct page *page, size_t offset, size_t n)
{ … }
size_t copy_page_to_iter(struct page *page, size_t offset, size_t bytes,
struct iov_iter *i)
{ … }
EXPORT_SYMBOL(…);
size_t copy_page_to_iter_nofault(struct page *page, unsigned offset, size_t bytes,
struct iov_iter *i)
{ … }
EXPORT_SYMBOL(…);
size_t copy_page_from_iter(struct page *page, size_t offset, size_t bytes,
struct iov_iter *i)
{ … }
EXPORT_SYMBOL(…);
static __always_inline
size_t zero_to_user_iter(void __user *iter_to, size_t progress,
size_t len, void *priv, void *priv2)
{ … }
static __always_inline
size_t zero_to_iter(void *iter_to, size_t progress,
size_t len, void *priv, void *priv2)
{ … }
size_t iov_iter_zero(size_t bytes, struct iov_iter *i)
{ … }
EXPORT_SYMBOL(…);
size_t copy_page_from_iter_atomic(struct page *page, size_t offset,
size_t bytes, struct iov_iter *i)
{ … }
EXPORT_SYMBOL(…);
static void iov_iter_bvec_advance(struct iov_iter *i, size_t size)
{ … }
static void iov_iter_iovec_advance(struct iov_iter *i, size_t size)
{ … }
static void iov_iter_folioq_advance(struct iov_iter *i, size_t size)
{ … }
void iov_iter_advance(struct iov_iter *i, size_t size)
{ … }
EXPORT_SYMBOL(…);
static void iov_iter_folioq_revert(struct iov_iter *i, size_t unroll)
{ … }
void iov_iter_revert(struct iov_iter *i, size_t unroll)
{ … }
EXPORT_SYMBOL(…);
size_t iov_iter_single_seg_count(const struct iov_iter *i)
{ … }
EXPORT_SYMBOL(…);
void iov_iter_kvec(struct iov_iter *i, unsigned int direction,
const struct kvec *kvec, unsigned long nr_segs,
size_t count)
{ … }
EXPORT_SYMBOL(…);
void iov_iter_bvec(struct iov_iter *i, unsigned int direction,
const struct bio_vec *bvec, unsigned long nr_segs,
size_t count)
{ … }
EXPORT_SYMBOL(…);
void iov_iter_folio_queue(struct iov_iter *i, unsigned int direction,
const struct folio_queue *folioq, unsigned int first_slot,
unsigned int offset, size_t count)
{ … }
EXPORT_SYMBOL(…);
void iov_iter_xarray(struct iov_iter *i, unsigned int direction,
struct xarray *xarray, loff_t start, size_t count)
{ … }
EXPORT_SYMBOL(…);
void iov_iter_discard(struct iov_iter *i, unsigned int direction, size_t count)
{ … }
EXPORT_SYMBOL(…);
static bool iov_iter_aligned_iovec(const struct iov_iter *i, unsigned addr_mask,
unsigned len_mask)
{ … }
static bool iov_iter_aligned_bvec(const struct iov_iter *i, unsigned addr_mask,
unsigned len_mask)
{ … }
bool iov_iter_is_aligned(const struct iov_iter *i, unsigned addr_mask,
unsigned len_mask)
{ … }
EXPORT_SYMBOL_GPL(…);
static unsigned long iov_iter_alignment_iovec(const struct iov_iter *i)
{ … }
static unsigned long iov_iter_alignment_bvec(const struct iov_iter *i)
{ … }
unsigned long iov_iter_alignment(const struct iov_iter *i)
{ … }
EXPORT_SYMBOL(…);
unsigned long iov_iter_gap_alignment(const struct iov_iter *i)
{ … }
EXPORT_SYMBOL(…);
static int want_pages_array(struct page ***res, size_t size,
size_t start, unsigned int maxpages)
{ … }
static ssize_t iter_folioq_get_pages(struct iov_iter *iter,
struct page ***ppages, size_t maxsize,
unsigned maxpages, size_t *_start_offset)
{ … }
static ssize_t iter_xarray_populate_pages(struct page **pages, struct xarray *xa,
pgoff_t index, unsigned int nr_pages)
{ … }
static ssize_t iter_xarray_get_pages(struct iov_iter *i,
struct page ***pages, size_t maxsize,
unsigned maxpages, size_t *_start_offset)
{ … }
static unsigned long first_iovec_segment(const struct iov_iter *i, size_t *size)
{ … }
static struct page *first_bvec_segment(const struct iov_iter *i,
size_t *size, size_t *start)
{ … }
static ssize_t __iov_iter_get_pages_alloc(struct iov_iter *i,
struct page ***pages, size_t maxsize,
unsigned int maxpages, size_t *start)
{ … }
ssize_t iov_iter_get_pages2(struct iov_iter *i, struct page **pages,
size_t maxsize, unsigned maxpages, size_t *start)
{ … }
EXPORT_SYMBOL(…);
ssize_t iov_iter_get_pages_alloc2(struct iov_iter *i,
struct page ***pages, size_t maxsize, size_t *start)
{ … }
EXPORT_SYMBOL(…);
static int iov_npages(const struct iov_iter *i, int maxpages)
{ … }
static int bvec_npages(const struct iov_iter *i, int maxpages)
{ … }
int iov_iter_npages(const struct iov_iter *i, int maxpages)
{ … }
EXPORT_SYMBOL(…);
const void *dup_iter(struct iov_iter *new, struct iov_iter *old, gfp_t flags)
{ … }
EXPORT_SYMBOL(…);
static __noclone int copy_compat_iovec_from_user(struct iovec *iov,
const struct iovec __user *uvec, u32 nr_segs)
{ … }
static __noclone int copy_iovec_from_user(struct iovec *iov,
const struct iovec __user *uiov, unsigned long nr_segs)
{ … }
struct iovec *iovec_from_user(const struct iovec __user *uvec,
unsigned long nr_segs, unsigned long fast_segs,
struct iovec *fast_iov, bool compat)
{ … }
static ssize_t __import_iovec_ubuf(int type, const struct iovec __user *uvec,
struct iovec **iovp, struct iov_iter *i,
bool compat)
{ … }
ssize_t __import_iovec(int type, const struct iovec __user *uvec,
unsigned nr_segs, unsigned fast_segs, struct iovec **iovp,
struct iov_iter *i, bool compat)
{ … }
ssize_t import_iovec(int type, const struct iovec __user *uvec,
unsigned nr_segs, unsigned fast_segs,
struct iovec **iovp, struct iov_iter *i)
{ … }
EXPORT_SYMBOL(…);
int import_ubuf(int rw, void __user *buf, size_t len, struct iov_iter *i)
{ … }
EXPORT_SYMBOL_GPL(…);
void iov_iter_restore(struct iov_iter *i, struct iov_iter_state *state)
{ … }
static ssize_t iov_iter_extract_folioq_pages(struct iov_iter *i,
struct page ***pages, size_t maxsize,
unsigned int maxpages,
iov_iter_extraction_t extraction_flags,
size_t *offset0)
{ … }
static ssize_t iov_iter_extract_xarray_pages(struct iov_iter *i,
struct page ***pages, size_t maxsize,
unsigned int maxpages,
iov_iter_extraction_t extraction_flags,
size_t *offset0)
{ … }
static ssize_t iov_iter_extract_bvec_pages(struct iov_iter *i,
struct page ***pages, size_t maxsize,
unsigned int maxpages,
iov_iter_extraction_t extraction_flags,
size_t *offset0)
{ … }
static ssize_t iov_iter_extract_kvec_pages(struct iov_iter *i,
struct page ***pages, size_t maxsize,
unsigned int maxpages,
iov_iter_extraction_t extraction_flags,
size_t *offset0)
{ … }
static ssize_t iov_iter_extract_user_pages(struct iov_iter *i,
struct page ***pages,
size_t maxsize,
unsigned int maxpages,
iov_iter_extraction_t extraction_flags,
size_t *offset0)
{ … }
ssize_t iov_iter_extract_pages(struct iov_iter *i,
struct page ***pages,
size_t maxsize,
unsigned int maxpages,
iov_iter_extraction_t extraction_flags,
size_t *offset0)
{ … }
EXPORT_SYMBOL_GPL(…);