From b7f9a465f02ee4df7cba6773387cb3d3aeb9db30 Mon Sep 17 00:00:00 2001 From: Sharon Lin Date: Sun, 6 Jan 2019 16:49:36 -0500 Subject: [PATCH] added warning and error to sys_arch_prctl (#1319) * added warning and error to sys_arch_prctl * Changed error message and list to set literals * Removed trailing whitespace --- manticore/platforms/linux.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/manticore/platforms/linux.py b/manticore/platforms/linux.py index 72197d171..f62b8d4e8 100644 --- a/manticore/platforms/linux.py +++ b/manticore/platforms/linux.py @@ -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