From edaca2dd123cef958699c07ab248cf0ffc71af07 Mon Sep 17 00:00:00 2001 From: fanquake Date: Wed, 25 Mar 2020 08:11:20 +0800 Subject: scripts: add MACHO NX check to security-check.py --- contrib/devtools/security-check.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'contrib/devtools/security-check.py') diff --git a/contrib/devtools/security-check.py b/contrib/devtools/security-check.py index 21d64e893d..c05c38d513 100755 --- a/contrib/devtools/security-check.py +++ b/contrib/devtools/security-check.py @@ -197,6 +197,15 @@ def check_MACHO_NOUNDEFS(executable) -> bool: return True return False +def check_MACHO_NX(executable) -> bool: + ''' + Check for no stack execution + ''' + flags = get_MACHO_executable_flags(executable) + if 'ALLOW_STACK_EXECUTION' in flags: + return False + return True + CHECKS = { 'ELF': [ ('PIE', check_ELF_PIE), @@ -212,6 +221,7 @@ CHECKS = { 'MACHO': [ ('PIE', check_MACHO_PIE), ('NOUNDEFS', check_MACHO_NOUNDEFS), + ('NX', check_MACHO_NX) ] } -- cgit v1.2.3