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]
Date:   Wed, 23 Nov 2022 13:35:15 +0000
From:   David Howells <dhowells@...hat.com>
To:     Christoph Hellwig <hch@....de>, Al Viro <viro@...iv.linux.org.uk>,
        Matthew Wilcox <willy@...radead.org>
cc:     dhowells@...hat.com, torvalds@...ux-foundation.org,
        linux-mm@...ck.org, linux-fsdevel@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Should iov_iter_get_pages*() be EXPORT_SYMBOL_GPL?

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?

Link: https://lore.kernel.org/r/166920902005.1461876.2786264600108839814.stgit@warthog.procyon.org.uk/ [1]
Link: https://lore.kernel.org/r/Y3zFzdWnWlEJ8X8/@infradead.org/ [2]
Link: https://lore.kernel.org/lkml/20221025154143.GA25128@lst.de/ [3]
---
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].

Reported-by: Christoph Hellwig <hch@....de>
Signed-off-by: David Howells <dhowells@...hat.com>
cc: Al Viro <viro@...iv.linux.org.uk>
cc: Matthew Wilcox <willy@...radead.org>
cc: linux-mm@...ck.org
cc: linux-fsdevel@...r.kernel.org
Link: https://lore.kernel.org/r/Y3zFzdWnWlEJ8X8/@infradead.org/ [1]
---
 iov_iter.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/iov_iter.c b/lib/iov_iter.c
index 612fc9bf9881..02b02a5fece4 100644
--- a/lib/iov_iter.c
+++ b/lib/iov_iter.c
@@ -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)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ