Skip to contentSkip to conversation

x86/pkeys: Return correctly on a pkey error

PATCH New Aneesh Kumar K.V 1 participant 1 message Feb 27, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 x86/pkeys: Return correctly on a pkey error

This was found by code review

Fixes 9db812dbb29d ("signal/x86: Call force_sig_pkuerr from __bad_area_nosemaphore")

---
Changes from V1:
* update commit message

 arch/x86/mm/fault.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
arch/x86/mm/fault.c +3 -1
index fa4ea09593ab..f80a7ad010dc 100644
@@ -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);
 
Signature · 1 line
2.24.1