Skip to content

Commit

Permalink
added warning and error to sys_arch_prctl (#1319)
Browse files Browse the repository at this point in the history
* added warning and error to sys_arch_prctl

* Changed error message and list to set literals

* Removed trailing whitespace
  • Loading branch information
sharon-lin authored and disconnect3d committed Jan 6, 2019
1 parent 64c75fb commit b7f9a46
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion manticore/platforms/linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -1412,7 +1412,11 @@ def sys_arch_prctl(self, code, addr):
ARCH_SET_FS = 0x1002
ARCH_GET_FS = 0x1003
ARCH_GET_GS = 0x1004
assert code == ARCH_SET_FS
if code not in {ARCH_SET_GS, ARCH_SET_FS, ARCH_GET_FS, ARCH_GET_GS}:
logger.debug("code not in expected options ARCH_GET/SET_FS/GS")
return -errno.EINVAL
if code != ARCH_SET_FS:
raise NotImplementedError("Manticore supports only arch_prctl with code=ARCH_SET_FS (0x1002) for now")
self.current.FS = 0x63
self.current.set_descriptor(self.current.FS, addr, 0x4000, 'rw')
return 0
Expand Down

0 comments on commit b7f9a46

Please sign in to comment.