linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2] powerpc/mm: Invalidate subpage_prot() system call on radix platforms
@ 2017-12-04  5:49 Anshuman Khandual
  2018-01-22  3:34 ` [V2] " Michael Ellerman
  0 siblings, 1 reply; 2+ messages in thread
From: Anshuman Khandual @ 2017-12-04  5:49 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: mpe, aneesh.kumar

Radix enabled platforms don't support subpage_prot() system calls. But
at present the system call goes through without an error and fails
later on while validating expected subpage accesses. Lets not allow
the system call on powerpc radix platforms to begin with to prevent
this confusion in user space.

Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>
---
Changes in V2:

Now it returns -ENOENT error instead as per Michael Ellerman.

 arch/powerpc/mm/subpage-prot.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/powerpc/mm/subpage-prot.c b/arch/powerpc/mm/subpage-prot.c
index 781532d..f14a07c 100644
--- a/arch/powerpc/mm/subpage-prot.c
+++ b/arch/powerpc/mm/subpage-prot.c
@@ -195,6 +195,9 @@ long sys_subpage_prot(unsigned long addr, unsigned long len, u32 __user *map)
 	unsigned long next, limit;
 	int err;
 
+	if (radix_enabled())
+		return -ENOENT;
+
 	/* Check parameters */
 	if ((addr & ~PAGE_MASK) || (len & ~PAGE_MASK) ||
 	    addr >= mm->task_size || len >= mm->task_size ||
-- 
1.8.3.1

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

* Re: [V2] powerpc/mm: Invalidate subpage_prot() system call on radix platforms
  2017-12-04  5:49 [PATCH V2] powerpc/mm: Invalidate subpage_prot() system call on radix platforms Anshuman Khandual
@ 2018-01-22  3:34 ` Michael Ellerman
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2018-01-22  3:34 UTC (permalink / raw)
  To: Anshuman Khandual, linuxppc-dev; +Cc: aneesh.kumar

On Mon, 2017-12-04 at 05:49:22 UTC, Anshuman Khandual wrote:
> Radix enabled platforms don't support subpage_prot() system calls. But
> at present the system call goes through without an error and fails
> later on while validating expected subpage accesses. Lets not allow
> the system call on powerpc radix platforms to begin with to prevent
> this confusion in user space.
> 
> Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/5b2b80714796073ec9e196c7aeec59

cheers

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

end of thread, other threads:[~2018-01-22  3:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-04  5:49 [PATCH V2] powerpc/mm: Invalidate subpage_prot() system call on radix platforms Anshuman Khandual
2018-01-22  3:34 ` [V2] " Michael Ellerman

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).