Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1549954

Re: [v2 2/7] x86/mpx: Fail when implicit zero-displacement is used along with R/EBP

From Dave Hansen <dave.hansen@linux.intel.com>
Newsgroups linux.kernel
Subject Re: [v2 2/7] x86/mpx: Fail when implicit zero-displacement is used along with R/EBP
Date 2017-01-03 17:50 +0100
Message-ID <sVArE-DT-27@gated-at.bofh.it> (permalink)
References <sRJtv-6WG-7@gated-at.bofh.it> <sRJDb-75l-7@gated-at.bofh.it> <sRJMR-7ep-1@gated-at.bofh.it> <sT8zv-83k-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 12/27/2016 02:33 PM, Ricardo Neri wrote:
>>> diff --git a/arch/x86/mm/mpx.c b/arch/x86/mm/mpx.c
>>> index 6a75a75..71681d0 100644
>>> --- a/arch/x86/mm/mpx.c
>>> +++ b/arch/x86/mm/mpx.c
>>> @@ -120,6 +120,13 @@ static int get_reg_offset(struct insn *insn, struct pt_regs *regs,
>>>
>>>         case REG_TYPE_BASE:
>>>                 regno = X86_SIB_BASE(insn->sib.value);
>>> +               if (regno == 5 && X86_MODRM_RM(insn->modrm.value) == 0) {
>>> +                       WARN_ONCE(1, "An explicit displacement is required when %sBP used as SIB base.",
>>> +                                 (IS_ENABLED(CONFIG_X86_64) && insn->x86_64) ?
>>> +                                 "R13 or R" : "E");
>>> +                       return -EINVAL;
>>> +               }
>>> +
>> Now that I've read the cover letter, I see what's going on.  This
>> should not warn -- user code can easily trigger this deliberately.
> OK, I'll remove it. Are you concerned about the warning printing the
> calltrace, even only once?

Yes.  We don't let userspace spam the kernel, even once.  If we have a
couple thousand "only once" places, then userspace can overwhelm the
kernel log.

Also, this needs a much better description of what's going on in the
code.  Could you add a comment explaining what's going on, and why
regno==5, etc...?

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[v2 0/7] x86: enable User-Mode Instruction Prevention Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2016-12-24 02:40 +0100
  [v2 5/7] x86: Add emulation code for UMIP instructions Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2016-12-24 02:40 +0100
    Re: [v2 5/7] x86: Add emulation code for UMIP instructions Andy Lutomirski <luto@amacapital.net> - 2016-12-24 03:20 +0100
      Re: [v2 5/7] x86: Add emulation code for UMIP instructions Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2016-12-28 01:40 +0100
        Re: [v2 5/7] x86: Add emulation code for UMIP instructions Andy Lutomirski <luto@amacapital.net> - 2016-12-28 01:50 +0100
          Re: [v2 5/7] x86: Add emulation code for UMIP instructions Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2016-12-30 06:30 +0100
            Re: [v2 5/7] x86: Add emulation code for UMIP instructions Andy Lutomirski <luto@amacapital.net> - 2016-12-31 03:10 +0100
              Re: [v2 5/7] x86: Add emulation code for UMIP instructions Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2017-01-04 02:40 +0100
    Re: [v2 5/7] x86: Add emulation code for UMIP instructions Masami Hiramatsu <mhiramat@kernel.org> - 2016-12-25 17:00 +0100
      Re: [v2 5/7] x86: Add emulation code for UMIP instructions Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2016-12-28 01:50 +0100
  [v2 3/7] x86/mpx, x86/insn: Relocate insn util functions to a new insn-utils Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2016-12-24 02:40 +0100
    Re: [v2 3/7] x86/mpx, x86/insn: Relocate insn util functions to a  new insn-utils kbuild test robot <lkp@intel.com> - 2016-12-24 03:40 +0100
    Re: [v2 3/7] x86/mpx, x86/insn: Relocate insn util functions to a  new insn-utils Masami Hiramatsu <mhiramat@kernel.org> - 2016-12-25 07:20 +0100
      Re: [v2 3/7] x86/mpx, x86/insn: Relocate insn util functions to a  new insn-utils Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2016-12-27 23:40 +0100
    Re: [v2 3/7] x86/mpx, x86/insn: Relocate insn util functions to a new  insn-utils Dave Hansen <dave.hansen@linux.intel.com> - 2017-01-03 17:50 +0100
      Re: [v2 3/7] x86/mpx, x86/insn: Relocate insn util functions to a  new insn-utils Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2017-01-04 02:40 +0100
  [v2 2/7] x86/mpx: Fail when implicit zero-displacement is used along with R/EBP Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2016-12-24 02:50 +0100
    Re: [v2 2/7] x86/mpx: Fail when implicit zero-displacement is used  along with R/EBP Andy Lutomirski <luto@amacapital.net> - 2016-12-24 03:00 +0100
      Re: [v2 2/7] x86/mpx: Fail when implicit zero-displacement is used  along with R/EBP Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2016-12-27 23:40 +0100
        Re: [v2 2/7] x86/mpx: Fail when implicit zero-displacement is used  along with R/EBP Dave Hansen <dave.hansen@linux.intel.com> - 2017-01-03 17:50 +0100
          Re: [v2 2/7] x86/mpx: Fail when implicit zero-displacement is used  along with R/EBP Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2017-01-04 02:40 +0100

csiph-web