public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC] mm: Allow 64-bit mmap syscalls to access higher addresses.
@ 2020-09-25 15:37 Derek Lesho
  2020-09-25 16:53 ` Derek Lesho
  0 siblings, 1 reply; 2+ messages in thread
From: Derek Lesho @ 2020-09-25 15:37 UTC (permalink / raw)
  To: linux-kernel; +Cc: Derek Lesho

For those curious about my usecase, I'm working on running some windows 64-bit driver code in context of any given process.  I accomplish this by mapping some of the fake kernel
bits in the target process, and running the code in a dedicated thread.
---
 mm/mmap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/mmap.c b/mm/mmap.c
index 40248d84ad5f..3a6940ef6128 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -2240,7 +2240,7 @@ get_unmapped_area(struct file *file, unsigned long addr, unsigned long len,
 	if (IS_ERR_VALUE(addr))
 		return addr;
 
-	if (addr > TASK_SIZE - len)
+	if (addr > TASK_SIZE_MAX - len)
 		return -ENOMEM;
 	if (offset_in_page(addr))
 		return -EINVAL;
@@ -2767,7 +2767,7 @@ int __do_munmap(struct mm_struct *mm, unsigned long start, size_t len,
 	unsigned long end;
 	struct vm_area_struct *vma, *prev, *last;
 
-	if ((offset_in_page(start)) || start > TASK_SIZE || len > TASK_SIZE-start)
+	if ((offset_in_page(start)) || start > TASK_SIZE_MAX || len > TASK_SIZE_MAX-start)
 		return -EINVAL;
 
 	len = PAGE_ALIGN(len);
-- 
2.28.0


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

end of thread, other threads:[~2020-09-25 16:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-25 15:37 [RFC] mm: Allow 64-bit mmap syscalls to access higher addresses Derek Lesho
2020-09-25 16:53 ` Derek Lesho

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox