lkml.org 
[lkml]   [2020]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2] x86/pkeys: Return correctly on a pkey error
Date
This was found by code review

Fixes: 9db812dbb29d ("signal/x86: Call force_sig_pkuerr from __bad_area_nosemaphore")
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
---
Changes from V1:
* update commit message

arch/x86/mm/fault.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index fa4ea09593ab..f80a7ad010dc 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -899,8 +899,10 @@ __bad_area_nosemaphore(struct pt_regs *regs, unsigned long error_code,

set_signal_archinfo(address, error_code);

- if (si_code == SEGV_PKUERR)
+ if (si_code == SEGV_PKUERR) {
force_sig_pkuerr((void __user *)address, pkey);
+ return;
+ }

force_sig_fault(SIGSEGV, si_code, (void __user *)address);

--
2.24.1
\
 
 \ /
  Last update: 2020-02-27 13:59    [W:0.024 / U:0.988 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site