Re: [PATCH v9 06/29] x86/mpx: Use signed variables to compute effective addresses

From: Neri, Ricardo
Date: Thu Oct 05 2017 - 13:38:47 EST


On Thu, 2017-10-05 at 11:41 +0200, Borislav Petkov wrote:
> On Tue, Oct 03, 2017 at 08:54:09PM -0700, Ricardo Neri wrote:
> >
> > Even though memory addresses are unsigned, the operands used to compute the
> > effective address do have a sign. This is true for ModRM.rm, SIB.base,
> > SIB.index as well as the displacement bytes. Thus, signed variables shall
> > be used when computing the effective address from these operands. Once the
> > signed effective address has been computed, it is casted to an unsigned
> > long to determine the linear address.
> >
> > Variables are renamed to better reflect the type of address being
> > computed.
> >
> > 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 | 20 ++++++++++++++------
> > Â1 file changed, 14 insertions(+), 6 deletions(-)
> Reviewed-by: Borislav Petkov <bp@xxxxxxx>

Thank you!

BR,
Ricardo