Should iov_iter_get_pages*() be EXPORT_SYMBOL_GPL?
Subsystems (4)
I recently posted an intended replacement[1] for iov_iter_get_pages*() which, instead of always just getting a ref on the pages it extracts from the iterator it is given, will pin them or leave them unaltered (but still in the list) as appropriate.
However, Christoph objected[2] to my using EXPORT_SYMBOL() with it on the basis that:
get_user_pages_fast, pin_user_pages_fast are very intentionally EXPORT_SYMBOL_GPL, which should not be bypassed by an iov_* wrapper.
but iov_iter_get_pages*() is EXPORT_SYMBOL(), so it's already possible to bypass this restriction. He has also raised other objections[3].
Should we then convert this to EXPORT_SYMBOL_GPL(), as per the attached patch?
---iov_iter: Mark iov_iter_get_pages2*() as EXPORT_SYMBOL_GPL()
iov_iter_get_pages2*() should be marked EXPORT_SYMBOL_GPL() as the use get_user_pages_fast()[1].
--- iov_iter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
lib/iov_iter.c +2 -2
@@ -1502,7 +1502,7 @@ ssize_t iov_iter_get_pages2(struct iov_iter *i,return __iov_iter_get_pages_alloc (i, &pages, maxsize, maxpages, start); } -EXPORT_SYMBOL (iov_iter_get_pages2); +EXPORT_SYMBOL_GPL (iov_iter_get_pages2); ssize_t iov_iter_get_pages_alloc2(struct iov_iter *i, struct page ***pages, size_t maxsize,
@@ -1519,7 +1519,7 @@ ssize_t iov_iter_get_pages_alloc2(struct iov_iter *i, }return len; } -EXPORT_SYMBOL (iov_iter_get_pages_alloc2); +EXPORT_SYMBOL_GPL (iov_iter_get_pages_alloc2);size_t csum_and_copy_from_iter (void *addr,size_t bytes,__wsum *csum,struct iov_iter *i)