Re: [PATCH v8 07/28] x86/mpx: Do not use SIB.base if its value is 101b and ModRM.mod = 0

From: Borislav Petkov
Date: Wed Sep 06 2017 - 11:44:43 EST


On Fri, Aug 18, 2017 at 05:27:48PM -0700, Ricardo Neri wrote:
> Section 2.2.1.2 of the Intel 64 and IA-32 Architectures Software
> Developer's Manual volume 2A states that if a SIB byte is used and
> SIB.base is 101b and ModRM.mod is zero, then the base part of the base
> part of the effective address computation is null. To signal this
> situation, a -EDOM error is returned to indicate callers to ignore the
> base value present in the register operand.
>
> In this scenario, a 32-bit displacement follows the SIB byte. Displacement
> is obtained when the instruction decoder parses the operands.
>
> Cc: Borislav Petkov <bp@xxxxxxx>
> Cc: Andy Lutomirski <luto@xxxxxxxxxx>
> Cc: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>
> Cc: Adam Buchbinder <adam.buchbinder@xxxxxxxxx>
> Cc: Colin Ian King <colin.king@xxxxxxxxxxxxx>
> Cc: Lorenzo Stoakes <lstoakes@xxxxxxxxx>
> Cc: Qiaowei Ren <qiaowei.ren@xxxxxxxxx>
> Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
> Cc: Nathan Howard <liverlint@xxxxxxxxx>
> Cc: Adan Hawthorn <adanhawthorn@xxxxxxxxx>
> Cc: Joe Perches <joe@xxxxxxxxxxx>
> Cc: Ravi V. Shankar <ravi.v.shankar@xxxxxxxxx>
> Cc: x86@xxxxxxxxxx
> Signed-off-by: Ricardo Neri <ricardo.neri-calderon@xxxxxxxxxxxxxxx>
> ---
> arch/x86/mm/mpx.c | 28 +++++++++++++++++++---------
> 1 file changed, 19 insertions(+), 9 deletions(-)

Reviewed-by: Borislav Petkov <bp@xxxxxxx>

--
Regards/Gruss,
Boris.

SUSE Linux GmbH, GF: Felix ImendÃrffer, Jane Smithard, Graham Norton, HRB 21284 (AG NÃrnberg)
--