[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMzpN2if2m4McWpL49U4QAEM1MJ+qgTe-emN8vKcjVc1H+84vA@mail.gmail.com>
Date: Thu, 19 Dec 2019 22:48:13 -0500
From: Brian Gerst <brgerst@...il.com>
To: Andy Lutomirski <luto@...nel.org>
Cc: X86 ML <x86@...nel.org>, LKML <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...nel.org>,
"H . Peter Anvin" <hpa@...or.com>,
Boris Ostrovsky <boris.ostrovsky@...cle.com>,
Oleg Nesterov <oleg@...hat.com>
Subject: Re: [PATCH] x86: Remove force_iret()
On Thu, Dec 19, 2019 at 8:50 PM Andy Lutomirski <luto@...nel.org> wrote:
>
> On Thu, Dec 19, 2019 at 3:58 AM Brian Gerst <brgerst@...il.com> wrote:
> >
> > force_iret() was originally intended to prevent the return to user mode with
> > the SYSRET or SYSEXIT instructions, in cases where the register state could
> > have been changed to be incompatible with those instructions.
>
> It's more than that. Before the big syscall rework, we didn't restore
> the caller-saved regs. See:
>
> commit 21d375b6b34ff511a507de27bf316b3dde6938d9
> Author: Andy Lutomirski <luto@...nel.org>
> Date: Sun Jan 28 10:38:49 2018 -0800
>
> x86/entry/64: Remove the SYSCALL64 fast path
>
> So if you changed r12, for example, the change would get lost.
force_iret() specifically dealt with changes to CS, SS and EFLAGS.
Saving and restoring the extra registers was a different problem
although it affected the same functions like ptrace, signals, and
exec.
--
Brian Gerst
Powered by blists - more mailing lists