https://bugs.kde.org/show_bug.cgi?id=371491

            Bug ID: 371491
           Summary: handleAddrOverrides() is truncating the segment base
                    address when ASO prefix is used
           Product: valgrind
           Version: unspecified
          Platform: Other
                OS: other
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: vex
          Assignee: [email protected]
          Reporter: [email protected]

When running Valgrind on amd64, I believe handleAddrOverrides() is
incorrectly truncating the segment base addresses when the address-size
override prefix is used.

The way I stumbled upon this was having a value over the 4GB boundary
in the fs register and hitting this instruction:

0x0000000000052105 <+5>: 64 67 8b 00 mov %fs:(%eax),%eax

The final address is truncated, which ends up reading from the wrong
location.

Intel Developers Manual (Address Calculations in 64-Bit Mode) says that
the base is added after the effective address is truncated, and that
the base itself does not get truncated. The AMD64 Programmers Manual
Vol2 says something similar.

Reproducible: Always

Steps to Reproduce:
I do not have a good way to test / reproduce the problem.

One possible way would be to have your kernel put its per-cpu data in high
memory so that the fs segment is over the 4GB boundary, then use an instruction
like the one in the description.

Actual Results:  
The segment base address gets truncated and the read happens from the wrong
address.

Expected Results:  
The segment base address is not touched and the read happens from the right
address.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to