Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle app using same segment register #107

Open
derekbruening opened this issue Nov 27, 2014 · 2 comments
Open

handle app using same segment register #107

derekbruening opened this issue Nov 27, 2014 · 2 comments

Comments

@derekbruening
Copy link
Contributor

From derek.br...@gmail.com on April 02, 2009 23:10:32

this was PR 205276: use fs/gs segment transparently on linux

we do not currently handle an app that uses the segment register we do (the
one that pthreads does not use). that means we will have issues w/ wine.

Original issue: http://code.google.com/p/dynamorio/issues/detail?id=107

@derekbruening
Copy link
Contributor Author

From qin.zhao@gmail.com on April 12, 2011 12:40:34

The issue is mostly fixed by revision 724 .
We keep this issue open till the code is better tested and more robust.

@derekbruening
Copy link
Contributor Author

From qin.zhao@gmail.com on April 12, 2011 15:02:43

We resolve this issue in revision 718 by mangling the application's memory reference via FS/GS.
For example, for instruction:
mov [%fs:0x10] => %rax,
we can change it to
mov app-fs-base => %rax
mov [%rax, 0x10] => %rax

There are 3 areas to be handled:

  1. mangle all memory reference via fs/gs
  2. mangle instructions that update/query fs/gs
  3. monitor system calls and maintain information about application's tls segment.

There are some corner cases are not handled yet, including

  1. indirect branch using xcx and seg, e.g. [%fs:ecx]
  2. support get TSL segment base (now only enabled when private_loader is on)
  3. check segment bound on mangled far memory access if the segment size is not unlimited.
  4. update/query seg might cause access violation which should be handled.
  5. handle system call modify_ldt if necessary
  6. add testing cases

derekbruening added a commit that referenced this issue Sep 10, 2020
An app with a far cti that uses rcx/ecx but whose segment is flat (cs,
ds, es) today raises a debug-build assert.  It works fine in release.
Here we relax the debug-build assert.

Adds a test case to common.decode which fails with the assert without
this fix.

Issue: #107
derekbruening added a commit that referenced this issue Sep 10, 2020
An app with a far cti that uses rcx/ecx but whose segment is flat (cs,
ds, es) today raises a debug-build assert.  It works fine in release.
Here we relax the debug-build assert.

Adds a test case to common.decode which fails with the assert without
this fix.

Issue: #107
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant