Re: [PATCH v7 10/26] x86/insn-eval: Add utility functions to get segment selector

2017-06-15 Thread Ricardo Neri
On Tue, 2017-05-30 at 12:35 +0200, Borislav Petkov wrote: > On Fri, May 05, 2017 at 11:17:08AM -0700, Ricardo Neri wrote: > > When computing a linear address and segmentation is used, we need to know > > the base address of the segment involved in the computation. In most of > > the cases, the

Re: [PATCH v7 10/26] x86/insn-eval: Add utility functions to get segment selector

2017-06-15 Thread Ricardo Neri
On Thu, 2017-06-15 at 11:37 -0700, Ricardo Neri wrote: > > Yuck, didn't we talk about this already? > > I am sorry Borislav. I thought you agreed that I could use the values > of > the segment override prefixes to identify the segment registers [1]. This time with the reference: [1].

Re: [PATCH v7 13/26] x86/insn-eval: Add function to get default params of code segment

2017-06-15 Thread Ricardo Neri
On Wed, 2017-06-07 at 14:59 +0200, Borislav Petkov wrote: > On Fri, May 05, 2017 at 11:17:11AM -0700, Ricardo Neri wrote: > > This function returns the default values of the address and operand sizes > > as specified in the segment descriptor. This information is determined > > from the D and L

Re: [PATCH v7 16/26] x86/insn-eval: Support both signed 32-bit and 64-bit effective addresses

2017-06-15 Thread Ricardo Neri
On Wed, 2017-06-07 at 17:49 +0200, Borislav Petkov wrote: > On Fri, May 05, 2017 at 11:17:14AM -0700, Ricardo Neri wrote: > > @@ -697,18 +753,21 @@ void __user *insn_get_addr_ref(struct insn *insn, > > struct pt_regs *regs) > > { > > unsigned long linear_addr, seg_base_addr, seg_limit; > >

Re: [PATCH v7 14/26] x86/insn-eval: Indicate a 32-bit displacement if ModRM.mod is 0 and ModRM.rm is 5

2017-06-15 Thread Ricardo Neri
On Wed, 2017-06-07 at 15:15 +0200, Borislav Petkov wrote: > On Fri, May 05, 2017 at 11:17:12AM -0700, Ricardo Neri wrote: > > Section 2.2.1.3 of the Intel 64 and IA-32 Architectures Software > > Developer's Manual volume 2A states that when ModRM.mod is zero and > > ModRM.rm is 101b, a 32-bit

Re: [PATCH v7 18/26] x86/insn-eval: Add support to resolve 16-bit addressing encodings

2017-06-15 Thread Ricardo Neri
On Wed, 2017-06-07 at 18:28 +0200, Borislav Petkov wrote: > On Fri, May 05, 2017 at 11:17:16AM -0700, Ricardo Neri wrote: > > Tasks running in virtual-8086 mode or in protected mode with code > > segment descriptors that specify 16-bit default address sizes via the > > D bit will use 16-bit