[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <22a86224-4d25-a679-5449-e88ea889d499@intel.com>
Date: Thu, 6 Dec 2018 10:22:32 -0800
From: Dave Hansen <dave.hansen@...el.com>
To: Sean Christopherson <sean.j.christopherson@...el.com>,
Andy Lutomirski <luto@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
x86@...nel.org, Dave Hansen <dave.hansen@...ux.intel.com>,
Peter Zijlstra <peterz@...radead.org>
Cc: "H. Peter Anvin" <hpa@...or.com>, linux-kernel@...r.kernel.org,
Andy Lutomirski <luto@...capital.net>,
Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>,
Josh Triplett <josh@...htriplett.org>
Subject: Re: [RFC PATCH 3/4] x86/traps: Attempt to fixup exceptions in vDSO
before signaling
On 12/5/18 3:20 PM, Sean Christopherson wrote:
> @@ -223,6 +224,10 @@ do_trap_no_signal(struct task_struct *tsk, int trapnr, const char *str,
> tsk->thread.error_code = error_code;
> tsk->thread.trap_nr = trapnr;
>
> + if (user_mode(regs) &&
> + fixup_vdso_exception(regs, trapnr, error_code, 0))
> + return 0;
> +
> return -1;
> }
>
> @@ -563,6 +568,9 @@ do_general_protection(struct pt_regs *regs, long error_code)
> tsk->thread.error_code = error_code;
> tsk->thread.trap_nr = X86_TRAP_GP;
>
> + if (fixup_vdso_exception(regs, X86_TRAP_GP, error_code, 0))
> + return;
> +
> show_signal(tsk, SIGSEGV, "", desc, regs, error_code);
>
> force_sig(SIGSEGV, tsk);
> @@ -854,6 +862,9 @@ static void math_error(struct pt_regs *regs, int error_code, int trapnr)
> if (!si_code)
> return;
>
> + if (fixup_vdso_exception(regs, trapnr, error_code, 0))
> + return;
> +
> force_sig_fault(SIGFPE, si_code,
> (void __user *)uprobe_get_trap_addr(regs), task);
> }
> --
Needs commenting, please.
But, also, this seems really ad-hoc. Probably, that's a result of our
signal generation being really ad-hoc itself. But, if this claims
"Attempt to fixup exceptions in vDSO before signaling", how do we assure
ourselves that we hit all the ad-hoc signal generation cases? How do we
know we didn't miss one or ten?
I want to hear more of the story of how you picked these sites and also
decided that this is a comprehensive-enough set of sites to patch.
Powered by blists - more mailing lists