lkml.org 
[lkml]   [2018]   [Jun]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC v3 PATCH 5/5] x86: check VM_DEAD flag in page fault
Date
Check VM_DEAD flag of vma in page fault handler, if it is set, trigger
SIGSEGV.

Cc: Michal Hocko <mhocko@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Yang Shi <yang.shi@linux.alibaba.com>
---
arch/x86/mm/fault.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index 9a84a0d..3fd2da5 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -1357,6 +1357,10 @@ static inline bool smap_violation(int error_code, struct pt_regs *regs)
bad_area(regs, error_code, address);
return;
}
+ if (unlikely(vma->vm_flags & VM_DEAD)) {
+ bad_area(regs, error_code, address);
+ return;
+ }
if (error_code & X86_PF_USER) {
/*
* Accessing the stack below %sp is always a bug.
--
1.8.3.1
\
 
 \ /
  Last update: 2018-06-30 00:42    [W:0.499 / U:0.364 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site