[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <84eba553-2e0b-1a90-d543-6b22c1b3c5f8@linux.vnet.ibm.com>
Date: Mon, 2 Jul 2018 10:45:03 +0200
From: Laurent Dufour <ldufour@...ux.vnet.ibm.com>
To: Yang Shi <yang.shi@...ux.alibaba.com>, mhocko@...nel.org,
willy@...radead.org, akpm@...ux-foundation.org,
peterz@...radead.org, mingo@...hat.com, acme@...nel.org,
alexander.shishkin@...ux.intel.com, jolsa@...hat.com,
namhyung@...nel.org, tglx@...utronix.de, hpa@...or.com
Cc: linux-mm@...ck.org, x86@...nel.org, linux-kernel@...r.kernel.org
Subject: Re: [RFC v3 PATCH 5/5] x86: check VM_DEAD flag in page fault
On 30/06/2018 00:39, Yang Shi wrote:
> Check VM_DEAD flag of vma in page fault handler, if it is set, trigger
> SIGSEGV.
>
> Cc: Michal Hocko <mhocko@...nel.org>
> Cc: Thomas Gleixner <tglx@...utronix.de>
> Cc: Ingo Molnar <mingo@...hat.com>
> Cc: "H. Peter Anvin" <hpa@...or.com>
> Signed-off-by: Yang Shi <yang.shi@...ux.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;
> + }
This will have to be done for all the supported architectures, what about doing
this check in handle_mm_fault() and return VM_FAULT_SIGSEGV ?
> if (error_code & X86_PF_USER) {
> /*
> * Accessing the stack below %sp is always a bug.
>
Powered by blists - more mailing lists