Thread (30 messages) 30 messages, 5 authors, 2019-03-05

Re: [PATCH v10 04/12] mm, arm64: untag user pointers passed to memory syscalls

From: Andrey Konovalov <hidden>
Date: 2019-02-26 14:41:41
Also in: linux-arch, linux-doc, linux-kselftest, linux-mm, lkml

On Sat, Feb 23, 2019 at 12:07 AM Dave Hansen [off-list ref] wrote:
On 2/22/19 4:53 AM, Andrey Konovalov wrote:
quoted
--- a/mm/mprotect.c
+++ b/mm/mprotect.c
@@ -578,6 +578,7 @@ static int do_mprotect_pkey(unsigned long start, size_t len,
 SYSCALL_DEFINE3(mprotect, unsigned long, start, size_t, len,
              unsigned long, prot)
 {
+     start = untagged_addr(start);
      return do_mprotect_pkey(start, len, prot, -1);
 }
@@ -586,6 +587,7 @@ SYSCALL_DEFINE3(mprotect, unsigned long, start, size_t, len,
 SYSCALL_DEFINE4(pkey_mprotect, unsigned long, start, size_t, len,
              unsigned long, prot, int, pkey)
 {
+     start = untagged_addr(start);
      return do_mprotect_pkey(start, len, prot, pkey);
 }
This seems to have taken the approach of going as close as possible to
the syscall boundary and untagging the pointer there.  I guess that's
OK, but it does lead to more churn than necessary.  For instance, why
not just do the untagging in do_mprotect_pkey()?
I think that makes more sense, will do in the next version, thanks!
I think that's an overall design question.  I kinda asked the same thing
about patching call sites vs. VMA lookup functions.
Replied in the other thread.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help