mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
linux: Fix stack-related sub-process shutdown crashes (fixes #3912)
On Linux systems the stack frame reference canary will be purposely changed when forking sub-processes (see https://crbug.com/40181003). To avoid sub-process shutdown crashes the NO_STACK_PROTECTOR annotation must be added to all functions in the call stack leading to CefExecuteProcess(). Applications that cannot add this annotation must instead pass the `--change-stack-guard-on-fork=disable` command-line flag.
This commit is contained in:
@@ -522,9 +522,9 @@ def dict_to_str(dict):
|
||||
# Attribute keys allowed in CEF metadata comments.
|
||||
COMMON_ATTRIB_KEYS = ('added', 'removed')
|
||||
CLASS_ATTRIB_KEYS = COMMON_ATTRIB_KEYS + ('no_debugct_check', 'source')
|
||||
FUNCTION_ATTRIB_KEYS = COMMON_ATTRIB_KEYS + ('api_hash_check', 'capi_name',
|
||||
'count_func', 'default_retval',
|
||||
'index_param', 'optional_param')
|
||||
FUNCTION_ATTRIB_KEYS = COMMON_ATTRIB_KEYS + (
|
||||
'api_hash_check', 'capi_name', 'count_func', 'default_retval',
|
||||
'index_param', 'no_stack_protector', 'optional_param')
|
||||
|
||||
# regex for matching comment-formatted attributes
|
||||
_cre_attrib = r'/\*--cef\(([A-Za-z0-9_ ,=:\n]{0,})\)--\*/'
|
||||
|
@@ -9,10 +9,13 @@ import functools
|
||||
|
||||
|
||||
def make_cpptoc_impl_proto(name, func, parts):
|
||||
proto = ''
|
||||
if func.has_attrib('no_stack_protector'):
|
||||
proto += 'NO_STACK_PROTECTOR '
|
||||
if isinstance(func, obj_function_virtual):
|
||||
proto = parts['retval'] + ' CEF_CALLBACK'
|
||||
proto += parts['retval'] + ' CEF_CALLBACK'
|
||||
else:
|
||||
proto = 'CEF_EXPORT ' + parts['retval']
|
||||
proto += 'CEF_EXPORT ' + parts['retval']
|
||||
|
||||
proto += ' ' + name + '(' + ', '.join(parts['args']) + ')'
|
||||
return proto
|
||||
|
@@ -11,6 +11,8 @@ def make_ctocpp_impl_proto(clsname, name, func, parts):
|
||||
const = ''
|
||||
|
||||
proto = 'NO_SANITIZE("cfi-icall") '
|
||||
if func.has_attrib('no_stack_protector'):
|
||||
proto += 'NO_STACK_PROTECTOR '
|
||||
if clsname is None:
|
||||
proto += 'CEF_GLOBAL ' + parts['retval'] + ' '
|
||||
else:
|
||||
|
Reference in New Issue
Block a user