Upper load overflow address on x86

What happens when light load overflows the topmost address on x86? For example, what happens when a 4-byte integer is loaded at an address 0xfffffffe

on a 32-bit x86 processor? Of course, the topmost page ( 0xfffff000

- 0xffffffff

) is mapped to some kind of physical memory, and the page is read / written, and the current boot program resides in the operating system kernel in Ring0. You can assume that loading 4 bytes into 0xfffffffc

is legal for simplicity.

Will loading like this generate a page error?

+3


source to share


1 answer


It will generate a general protection (#GP) error due to segment limits checking. The processor checks the segment limit when accessing data with the DS segment register, which is common. The segment limit of the segment segment of the DS is [0.0xffffffff).

The processor raises a general protection exception whenever an attempt is made to access the following addresses in the segment:

  • Byte at offset exceeding the effective limit
  • Word with an offset greater than (effective-1)
  • Doubleword with offset greater than (effective-3)
  • Quadword with an offset greater than (effective limit - 7)


According to the Intel x86 specification, "clearly unequal" calls (whether they are on the edge of your address space) can also cause generic security errors for AVX, FME, VEX, or SSE instructions.

Interestingly, the lowest and highest addresses are not the only boundaries in your address space where this could happen. More borders are mapped to x86_64 address spaces where there is a sparse / non- address space in the middle that your processor cannot use (because this way processor manufacturers can reduce the number of bits needed for many internal processors - after all, no one is using full 64-bit address space).

+3


source







All Articles