linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next] mm: mmap: increase sockets maximum memory size pgoff for 32bits
@ 2019-08-12 11:34 Ivan Khoronzhuk
  2019-08-12 12:43 ` [PATCH v2 " Ivan Khoronzhuk
  0 siblings, 1 reply; 7+ messages in thread
From: Ivan Khoronzhuk @ 2019-08-12 11:34 UTC (permalink / raw)
  To: bjorn.topel, linux-mm
  Cc: xdp-newbies, netdev, bpf, linux-kernel, akpm, ast,
	magnus.karlsson, Ivan Khoronzhuk

The AF_XDP sockets umem mapping interface uses XDP_UMEM_PGOFF_FILL_RING
and XDP_UMEM_PGOFF_COMPLETION_RING offsets. The offsets seems like are
established already and are part of configuration interface.

But for 32-bit systems, while AF_XDP socket configuration, the values
are to large to pass maximum allowed file size verification.
The offsets can be tuned ofc, but instead of changing existent
interface - extend max allowed file size for sockets. The 64-bit
systems seems like ok with this, so extend threshold only for
32-bits for now.

Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
---

Based on bpf-next/master

 mm/mmap.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/mm/mmap.c b/mm/mmap.c
index 7e8c3e8ae75f..238ce6b71405 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -1358,6 +1358,11 @@ static inline u64 file_mmap_size_max(struct file *file, struct inode *inode)
 	if (S_ISBLK(inode->i_mode))
 		return MAX_LFS_FILESIZE;
 
+#if BITS_PER_LONG == 32
+	if (S_ISSOCK(inode->i_mode))
+		return MAX_LFS_FILESIZE;
+#endif
+
 	/* Special "we do even unsigned file positions" case */
 	if (file->f_mode & FMODE_UNSIGNED_OFFSET)
 		return 0;
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-08-14 22:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-12 11:34 [PATCH bpf-next] mm: mmap: increase sockets maximum memory size pgoff for 32bits Ivan Khoronzhuk
2019-08-12 12:43 ` [PATCH v2 " Ivan Khoronzhuk
2019-08-12 21:19   ` Andrew Morton
2019-08-14 15:09     ` Ivan Khoronzhuk
2019-08-14 22:18       ` Andrew Morton
2019-08-13  8:02   ` Magnus Karlsson
2019-08-13  9:12     ` Ivan Khoronzhuk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).