[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20150507174136.4072692D@viggo.jf.intel.com>
Date: Thu, 07 May 2015 10:41:36 -0700
From: Dave Hansen <dave@...1.net>
To: dave@...1.net
Cc: linux-kernel@...r.kernel.org, x86@...nel.org
Subject: [PATCH 10/12] x86, pkeys: differentiate Protection Key faults from normal
---
b/arch/x86/mm/fault.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff -puN arch/x86/mm/fault.c~pkeys-12-fault-differentiation arch/x86/mm/fault.c
--- a/arch/x86/mm/fault.c~pkeys-12-fault-differentiation 2015-05-07 10:31:44.570330979 -0700
+++ b/arch/x86/mm/fault.c 2015-05-07 10:31:44.573331114 -0700
@@ -1009,6 +1009,15 @@ int show_unhandled_signals = 1;
static inline int
access_error(unsigned long error_code, struct vm_area_struct *vma)
{
+ /*
+ * Access or read was blocked by protection keys. We do
+ * this check before any others because we do not want
+ * to, for instance, confuse a protection-key-denied
+ * write with one for which we should do a COW.
+ */
+ if (error_code & PF_PK)
+ return 1;
+
if (error_code & PF_WRITE) {
/* write, present and write, not present: */
if (unlikely(!(vma->vm_flags & VM_WRITE)))
_
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists