lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <d56dbd1ad6914d2d8ef7e90c3862e17f@AcuMS.aculab.com>
Date:   Tue, 31 Mar 2020 13:52:23 +0000
From:   David Laight <David.Laight@...LAB.COM>
To:     Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: [RFC PATCH 12/12] lib/iov_iter: Remove import_iovec() and
 compat_import_iovec()


All the callers have been changed to use iovec_import() and
compat_iovec_import().

Signed-off-by: David Laight <david.laight@...lab.com>
---
 include/linux/uio.h |  8 -------
 lib/iov_iter.c      | 61 -----------------------------------------------------
 2 files changed, 69 deletions(-)

diff --git a/include/linux/uio.h b/include/linux/uio.h
index 1e7a3f1..a2762e1 100644
--- a/include/linux/uio.h
+++ b/include/linux/uio.h
@@ -271,20 +271,12 @@ struct iovec_cache {
 	struct iovec  iov[UIO_FASTIOV];
 };
 
-ssize_t import_iovec(int type, const struct iovec __user * uvector,
-		 unsigned nr_segs, unsigned fast_segs,
-		 struct iovec **iov, struct iov_iter *i);
-
 struct iovec *iovec_import(int type, const struct iovec __user * uvector,
 		unsigned int nr_segs, struct iovec_cache *cache,
 		struct iov_iter *i);
 
 #ifdef CONFIG_COMPAT
 struct compat_iovec;
-ssize_t compat_import_iovec(int type, const struct compat_iovec __user * uvector,
-		 unsigned nr_segs, unsigned fast_segs,
-		 struct iovec **iov, struct iov_iter *i);
-
 struct iovec *compat_iovec_import(int type,
 		const struct compat_iovec __user * uvector,
 		unsigned int nr_segs, struct iovec_cache *cache,
diff --git a/lib/iov_iter.c b/lib/iov_iter.c
index ab33b69..fc31e41 100644
--- a/lib/iov_iter.c
+++ b/lib/iov_iter.c
@@ -1739,47 +1739,6 @@ struct iovec *iovec_import(int type, const struct iovec __user * uvector,
 }
 EXPORT_SYMBOL(iovec_import);
 
-/**
- * import_iovec() - Copy an array of &struct iovec from userspace
- *     into the kernel, check that it is valid, and initialize a new
- *     &struct iov_iter iterator to access it.
- *
- * @type: One of %READ or %WRITE.
- * @uvector: Pointer to the userspace array.
- * @nr_segs: Number of elements in userspace array.
- * @fast_segs: Number of elements in @iov.
- * @iov: (input and output parameter) Pointer to pointer to (usually small
- *     on-stack) kernel array.
- * @i: Pointer to iterator that will be initialized on success.
- *
- * If the array pointed to by *@iov is large enough to hold all @nr_segs,
- * then this function places %NULL in *@iov on return. Otherwise, a new
- * array will be allocated and the result placed in *@.... This means that
- * the caller may call kfree() on *@iov regardless of whether the small
- * on-stack array was used or not (and regardless of whether this function
- * returns an error or not).
- *
- * Return: Negative error code on error, bytes imported on success
- */
-ssize_t import_iovec(int type, const struct iovec __user * uvector,
-		 unsigned nr_segs, unsigned fast_segs,
-		 struct iovec **iov, struct iov_iter *i)
-{
-	struct iovec *iov_kmalloc;
-
-	iov_kmalloc = iovec_import(type, uvector, nr_segs,
-		fast_segs >= UIO_FASTIOV ? (void *)*iov : NULL, i);
-
-	if (IS_ERR(iov_kmalloc)) {
-		*iov = NULL;
-		return PTR_ERR(iov_kmalloc);
-	}
-
-	*iov = iov_kmalloc;
-	return i->count;
-}
-EXPORT_SYMBOL(import_iovec);
-
 #ifdef CONFIG_COMPAT
 #include <linux/compat.h>
 
@@ -1849,26 +1808,6 @@ struct iovec *compat_iovec_import(int type,
 	return ERR_PTR(ret);
 }
 EXPORT_SYMBOL(compat_iovec_import);
-
-ssize_t compat_import_iovec(int type,
-		const struct compat_iovec __user * uvector,
-		unsigned nr_segs, unsigned fast_segs,
-		struct iovec **iov, struct iov_iter *i)
-{
-	struct iovec *iov_kmalloc;
-
-	iov_kmalloc = compat_iovec_import(type, uvector, nr_segs,
-		fast_segs >= UIO_FASTIOV ? (void *)*iov : NULL, i);
-
-	if (IS_ERR(iov_kmalloc)) {
-		*iov = NULL;
-		return PTR_ERR(iov_kmalloc);
-	}
-
-	*iov = iov_kmalloc;
-	return i->count;
-}
-EXPORT_SYMBOL(compat_import_iovec);
 #endif
 
 int import_single_range(int rw, void __user *buf, size_t len,
-- 
1.8.1.2

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ