/src/php-src/sapi/fuzzer/fuzzer-execute-common.h
Line | Count | Source |
1 | | /* |
2 | | +----------------------------------------------------------------------+ |
3 | | | Copyright © The PHP Group and Contributors. | |
4 | | +----------------------------------------------------------------------+ |
5 | | | This source file is subject to the Modified BSD License that is | |
6 | | | bundled with this package in the file LICENSE, and is available | |
7 | | | through the World Wide Web at <https://www.php.net/license/>. | |
8 | | | | |
9 | | | SPDX-License-Identifier: BSD-3-Clause | |
10 | | +----------------------------------------------------------------------+ |
11 | | | Authors: Nikita Popov <nikic@php.net> | |
12 | | +----------------------------------------------------------------------+ |
13 | | */ |
14 | | |
15 | | #include <main/php.h> |
16 | | |
17 | | #if defined(__FreeBSD__) |
18 | | # include <sys/sysctl.h> |
19 | | #endif |
20 | | |
21 | | #include "fuzzer.h" |
22 | | #include "fuzzer-sapi.h" |
23 | | #include "zend_exceptions.h" |
24 | | #include "zend_vm.h" |
25 | | |
26 | 219k | #define FILE_NAME "/tmp/fuzzer.php" |
27 | 243k | #define MAX_STEPS 1000 |
28 | 213k | #define MAX_SIZE (8 * 1024) |
29 | 1.06M | #define ZEND_VM_ENTER_BIT ((uintptr_t)1) |
30 | | |
31 | | static uint32_t steps_left; |
32 | | static bool bailed_out = false; |
33 | | |
34 | 897 | static zend_always_inline void fuzzer_bailout(void) { |
35 | 897 | bailed_out = true; |
36 | 897 | zend_bailout(); |
37 | 897 | } fuzzer-tracing-jit.c:fuzzer_bailout Line | Count | Source | 34 | 312 | static zend_always_inline void fuzzer_bailout(void) { | 35 | 312 | bailed_out = true; | 36 | 312 | zend_bailout(); | 37 | 312 | } |
fuzzer-function-jit.c:fuzzer_bailout Line | Count | Source | 34 | 466 | static zend_always_inline void fuzzer_bailout(void) { | 35 | 466 | bailed_out = true; | 36 | 466 | zend_bailout(); | 37 | 466 | } |
fuzzer-execute.c:fuzzer_bailout Line | Count | Source | 34 | 119 | static zend_always_inline void fuzzer_bailout(void) { | 35 | 119 | bailed_out = true; | 36 | 119 | zend_bailout(); | 37 | 119 | } |
|
38 | | |
39 | 1.10M | static zend_always_inline void fuzzer_step(void) { |
40 | 1.10M | if (--steps_left == 0) { |
41 | | /* Reset steps before bailing out, so code running after bailout (e.g. in |
42 | | * destructors) will get another MAX_STEPS, rather than UINT32_MAX steps. */ |
43 | 884 | steps_left = MAX_STEPS; |
44 | 884 | fuzzer_bailout(); |
45 | 884 | } |
46 | 1.10M | } fuzzer-tracing-jit.c:fuzzer_step Line | Count | Source | 39 | 374k | static zend_always_inline void fuzzer_step(void) { | 40 | 374k | if (--steps_left == 0) { | 41 | | /* Reset steps before bailing out, so code running after bailout (e.g. in | 42 | | * destructors) will get another MAX_STEPS, rather than UINT32_MAX steps. */ | 43 | 312 | steps_left = MAX_STEPS; | 44 | 312 | fuzzer_bailout(); | 45 | 312 | } | 46 | 374k | } |
fuzzer-function-jit.c:fuzzer_step Line | Count | Source | 39 | 545k | static zend_always_inline void fuzzer_step(void) { | 40 | 545k | if (--steps_left == 0) { | 41 | | /* Reset steps before bailing out, so code running after bailout (e.g. in | 42 | | * destructors) will get another MAX_STEPS, rather than UINT32_MAX steps. */ | 43 | 466 | steps_left = MAX_STEPS; | 44 | 466 | fuzzer_bailout(); | 45 | 466 | } | 46 | 545k | } |
fuzzer-execute.c:fuzzer_step Line | Count | Source | 39 | 182k | static zend_always_inline void fuzzer_step(void) { | 40 | 182k | if (--steps_left == 0) { | 41 | | /* Reset steps before bailing out, so code running after bailout (e.g. in | 42 | | * destructors) will get another MAX_STEPS, rather than UINT32_MAX steps. */ | 43 | 106 | steps_left = MAX_STEPS; | 44 | 106 | fuzzer_bailout(); | 45 | 106 | } | 46 | 182k | } |
|
47 | | |
48 | | static void (*orig_execute_ex)(zend_execute_data *execute_data); |
49 | | |
50 | 66.3k | static void fuzzer_execute_ex(zend_execute_data *execute_data) { |
51 | | |
52 | 66.3k | #ifdef ZEND_CHECK_STACK_LIMIT |
53 | 66.3k | if (UNEXPECTED(zend_call_stack_overflowed(EG(stack_limit)))) { |
54 | 0 | zend_call_stack_size_error(); |
55 | | /* No opline was executed before exception */ |
56 | 0 | EG(opline_before_exception) = NULL; |
57 | | /* Fall through to handle exception below. */ |
58 | 0 | } |
59 | 66.3k | #endif /* ZEND_CHECK_STACK_LIMIT */ |
60 | | |
61 | 66.3k | const zend_op *opline = EX(opline); |
62 | | |
63 | 1.00M | while (1) { |
64 | 1.00M | fuzzer_step(); |
65 | 1.00M | opline = ((zend_vm_opcode_handler_func_t) zend_get_opcode_handler_func(opline))(execute_data, opline); |
66 | 1.00M | if ((uintptr_t) opline & ZEND_VM_ENTER_BIT) { |
67 | 62.9k | opline = (const zend_op *) ((uintptr_t) opline & ~ZEND_VM_ENTER_BIT); |
68 | 62.9k | if (opline) { |
69 | 0 | execute_data = EG(current_execute_data); |
70 | 62.9k | } else { |
71 | 62.9k | return; |
72 | 62.9k | } |
73 | 62.9k | } |
74 | 1.00M | } |
75 | 66.3k | } fuzzer-tracing-jit.c:fuzzer_execute_ex Line | Count | Source | 50 | 5.62k | static void fuzzer_execute_ex(zend_execute_data *execute_data) { | 51 | | | 52 | 5.62k | #ifdef ZEND_CHECK_STACK_LIMIT | 53 | 5.62k | if (UNEXPECTED(zend_call_stack_overflowed(EG(stack_limit)))) { | 54 | 0 | zend_call_stack_size_error(); | 55 | | /* No opline was executed before exception */ | 56 | 0 | EG(opline_before_exception) = NULL; | 57 | | /* Fall through to handle exception below. */ | 58 | 0 | } | 59 | 5.62k | #endif /* ZEND_CHECK_STACK_LIMIT */ | 60 | | | 61 | 5.62k | const zend_op *opline = EX(opline); | 62 | | | 63 | 336k | while (1) { | 64 | 336k | fuzzer_step(); | 65 | 336k | opline = ((zend_vm_opcode_handler_func_t) zend_get_opcode_handler_func(opline))(execute_data, opline); | 66 | 336k | if ((uintptr_t) opline & ZEND_VM_ENTER_BIT) { | 67 | 5.29k | opline = (const zend_op *) ((uintptr_t) opline & ~ZEND_VM_ENTER_BIT); | 68 | 5.29k | if (opline) { | 69 | 0 | execute_data = EG(current_execute_data); | 70 | 5.29k | } else { | 71 | 5.29k | return; | 72 | 5.29k | } | 73 | 5.29k | } | 74 | 336k | } | 75 | 5.62k | } |
fuzzer-function-jit.c:fuzzer_execute_ex Line | Count | Source | 50 | 7.80k | static void fuzzer_execute_ex(zend_execute_data *execute_data) { | 51 | | | 52 | 7.80k | #ifdef ZEND_CHECK_STACK_LIMIT | 53 | 7.80k | if (UNEXPECTED(zend_call_stack_overflowed(EG(stack_limit)))) { | 54 | 0 | zend_call_stack_size_error(); | 55 | | /* No opline was executed before exception */ | 56 | 0 | EG(opline_before_exception) = NULL; | 57 | | /* Fall through to handle exception below. */ | 58 | 0 | } | 59 | 7.80k | #endif /* ZEND_CHECK_STACK_LIMIT */ | 60 | | | 61 | 7.80k | const zend_op *opline = EX(opline); | 62 | | | 63 | 495k | while (1) { | 64 | 495k | fuzzer_step(); | 65 | 495k | opline = ((zend_vm_opcode_handler_func_t) zend_get_opcode_handler_func(opline))(execute_data, opline); | 66 | 495k | if ((uintptr_t) opline & ZEND_VM_ENTER_BIT) { | 67 | 7.33k | opline = (const zend_op *) ((uintptr_t) opline & ~ZEND_VM_ENTER_BIT); | 68 | 7.33k | if (opline) { | 69 | 0 | execute_data = EG(current_execute_data); | 70 | 7.33k | } else { | 71 | 7.33k | return; | 72 | 7.33k | } | 73 | 7.33k | } | 74 | 495k | } | 75 | 7.80k | } |
fuzzer-execute.c:fuzzer_execute_ex Line | Count | Source | 50 | 52.9k | static void fuzzer_execute_ex(zend_execute_data *execute_data) { | 51 | | | 52 | 52.9k | #ifdef ZEND_CHECK_STACK_LIMIT | 53 | 52.9k | if (UNEXPECTED(zend_call_stack_overflowed(EG(stack_limit)))) { | 54 | 0 | zend_call_stack_size_error(); | 55 | | /* No opline was executed before exception */ | 56 | 0 | EG(opline_before_exception) = NULL; | 57 | | /* Fall through to handle exception below. */ | 58 | 0 | } | 59 | 52.9k | #endif /* ZEND_CHECK_STACK_LIMIT */ | 60 | | | 61 | 52.9k | const zend_op *opline = EX(opline); | 62 | | | 63 | 173k | while (1) { | 64 | 170k | fuzzer_step(); | 65 | 170k | opline = ((zend_vm_opcode_handler_func_t) zend_get_opcode_handler_func(opline))(execute_data, opline); | 66 | 170k | if ((uintptr_t) opline & ZEND_VM_ENTER_BIT) { | 67 | 50.2k | opline = (const zend_op *) ((uintptr_t) opline & ~ZEND_VM_ENTER_BIT); | 68 | 50.2k | if (opline) { | 69 | 0 | execute_data = EG(current_execute_data); | 70 | 50.2k | } else { | 71 | 50.2k | return; | 72 | 50.2k | } | 73 | 50.2k | } | 74 | 170k | } | 75 | 52.9k | } |
|
76 | | |
77 | | static zend_op_array *(*orig_compile_string)( |
78 | | zend_string *source_string, const char *filename, zend_compile_position position); |
79 | | |
80 | | static zend_op_array *fuzzer_compile_string( |
81 | 97 | zend_string *str, const char *filename, zend_compile_position position) { |
82 | 97 | if (ZSTR_LEN(str) > MAX_SIZE) { |
83 | | /* Avoid compiling huge inputs via eval(). */ |
84 | 0 | fuzzer_bailout(); |
85 | 0 | } |
86 | | |
87 | 97 | return orig_compile_string(str, filename, position); |
88 | 97 | } fuzzer-tracing-jit.c:fuzzer_compile_string Line | Count | Source | 81 | 36 | zend_string *str, const char *filename, zend_compile_position position) { | 82 | 36 | if (ZSTR_LEN(str) > MAX_SIZE) { | 83 | | /* Avoid compiling huge inputs via eval(). */ | 84 | 0 | fuzzer_bailout(); | 85 | 0 | } | 86 | | | 87 | 36 | return orig_compile_string(str, filename, position); | 88 | 36 | } |
fuzzer-function-jit.c:fuzzer_compile_string Line | Count | Source | 81 | 46 | zend_string *str, const char *filename, zend_compile_position position) { | 82 | 46 | if (ZSTR_LEN(str) > MAX_SIZE) { | 83 | | /* Avoid compiling huge inputs via eval(). */ | 84 | 0 | fuzzer_bailout(); | 85 | 0 | } | 86 | | | 87 | 46 | return orig_compile_string(str, filename, position); | 88 | 46 | } |
fuzzer-execute.c:fuzzer_compile_string Line | Count | Source | 81 | 15 | zend_string *str, const char *filename, zend_compile_position position) { | 82 | 15 | if (ZSTR_LEN(str) > MAX_SIZE) { | 83 | | /* Avoid compiling huge inputs via eval(). */ | 84 | 0 | fuzzer_bailout(); | 85 | 0 | } | 86 | | | 87 | 15 | return orig_compile_string(str, filename, position); | 88 | 15 | } |
|
89 | | |
90 | | static void (*orig_execute_internal)(zend_execute_data *execute_data, zval *return_value); |
91 | | |
92 | 100k | static void fuzzer_execute_internal(zend_execute_data *execute_data, zval *return_value) { |
93 | 100k | fuzzer_step(); |
94 | | |
95 | 100k | uint32_t num_args = ZEND_CALL_NUM_ARGS(execute_data); |
96 | 209k | for (uint32_t i = 0; i < num_args; i++) { |
97 | | /* Some internal functions like preg_replace() may be slow on large inputs. |
98 | | * Limit the maximum size of string inputs. */ |
99 | 109k | zval *arg = ZEND_CALL_VAR_NUM(execute_data, i); |
100 | 109k | if (Z_TYPE_P(arg) == IS_STRING && Z_STRLEN_P(arg) > MAX_SIZE) { |
101 | 13 | fuzzer_bailout(); |
102 | 13 | } |
103 | 109k | } |
104 | | |
105 | 100k | orig_execute_internal(execute_data, return_value); |
106 | 100k | } fuzzer-tracing-jit.c:fuzzer_execute_internal Line | Count | Source | 92 | 38.2k | static void fuzzer_execute_internal(zend_execute_data *execute_data, zval *return_value) { | 93 | 38.2k | fuzzer_step(); | 94 | | | 95 | 38.2k | uint32_t num_args = ZEND_CALL_NUM_ARGS(execute_data); | 96 | 81.8k | for (uint32_t i = 0; i < num_args; i++) { | 97 | | /* Some internal functions like preg_replace() may be slow on large inputs. | 98 | | * Limit the maximum size of string inputs. */ | 99 | 43.5k | zval *arg = ZEND_CALL_VAR_NUM(execute_data, i); | 100 | 43.5k | if (Z_TYPE_P(arg) == IS_STRING && Z_STRLEN_P(arg) > MAX_SIZE) { | 101 | 0 | fuzzer_bailout(); | 102 | 0 | } | 103 | 43.5k | } | 104 | | | 105 | 38.2k | orig_execute_internal(execute_data, return_value); | 106 | 38.2k | } |
fuzzer-function-jit.c:fuzzer_execute_internal Line | Count | Source | 92 | 49.8k | static void fuzzer_execute_internal(zend_execute_data *execute_data, zval *return_value) { | 93 | 49.8k | fuzzer_step(); | 94 | | | 95 | 49.8k | uint32_t num_args = ZEND_CALL_NUM_ARGS(execute_data); | 96 | 103k | for (uint32_t i = 0; i < num_args; i++) { | 97 | | /* Some internal functions like preg_replace() may be slow on large inputs. | 98 | | * Limit the maximum size of string inputs. */ | 99 | 53.8k | zval *arg = ZEND_CALL_VAR_NUM(execute_data, i); | 100 | 53.8k | if (Z_TYPE_P(arg) == IS_STRING && Z_STRLEN_P(arg) > MAX_SIZE) { | 101 | 0 | fuzzer_bailout(); | 102 | 0 | } | 103 | 53.8k | } | 104 | | | 105 | 49.8k | orig_execute_internal(execute_data, return_value); | 106 | 49.8k | } |
fuzzer-execute.c:fuzzer_execute_internal Line | Count | Source | 92 | 11.9k | static void fuzzer_execute_internal(zend_execute_data *execute_data, zval *return_value) { | 93 | 11.9k | fuzzer_step(); | 94 | | | 95 | 11.9k | uint32_t num_args = ZEND_CALL_NUM_ARGS(execute_data); | 96 | 23.9k | for (uint32_t i = 0; i < num_args; i++) { | 97 | | /* Some internal functions like preg_replace() may be slow on large inputs. | 98 | | * Limit the maximum size of string inputs. */ | 99 | 11.9k | zval *arg = ZEND_CALL_VAR_NUM(execute_data, i); | 100 | 11.9k | if (Z_TYPE_P(arg) == IS_STRING && Z_STRLEN_P(arg) > MAX_SIZE) { | 101 | 13 | fuzzer_bailout(); | 102 | 13 | } | 103 | 11.9k | } | 104 | | | 105 | 11.9k | orig_execute_internal(execute_data, return_value); | 106 | 11.9k | } |
|
107 | | |
108 | 6 | static void fuzzer_init_php_for_execute(const char *extra_ini) { |
109 | | /* Compilation will often trigger fatal errors. |
110 | | * Use tracked allocation mode to avoid leaks in that case. */ |
111 | 6 | putenv("USE_TRACKED_ALLOC=1"); |
112 | | |
113 | | /* Just like other SAPIs, ignore SIGPIPEs. */ |
114 | 6 | signal(SIGPIPE, SIG_IGN); |
115 | | |
116 | 6 | fuzzer_init_php(extra_ini); |
117 | | |
118 | 6 | orig_execute_ex = zend_execute_ex; |
119 | 6 | zend_execute_ex = fuzzer_execute_ex; |
120 | 6 | orig_execute_internal = zend_execute_internal ? zend_execute_internal : execute_internal; |
121 | 6 | zend_execute_internal = fuzzer_execute_internal; |
122 | 6 | orig_compile_string = zend_compile_string; |
123 | 6 | zend_compile_string = fuzzer_compile_string; |
124 | 6 | } fuzzer-tracing-jit.c:fuzzer_init_php_for_execute Line | Count | Source | 108 | 2 | static void fuzzer_init_php_for_execute(const char *extra_ini) { | 109 | | /* Compilation will often trigger fatal errors. | 110 | | * Use tracked allocation mode to avoid leaks in that case. */ | 111 | 2 | putenv("USE_TRACKED_ALLOC=1"); | 112 | | | 113 | | /* Just like other SAPIs, ignore SIGPIPEs. */ | 114 | 2 | signal(SIGPIPE, SIG_IGN); | 115 | | | 116 | 2 | fuzzer_init_php(extra_ini); | 117 | | | 118 | 2 | orig_execute_ex = zend_execute_ex; | 119 | 2 | zend_execute_ex = fuzzer_execute_ex; | 120 | 2 | orig_execute_internal = zend_execute_internal ? zend_execute_internal : execute_internal; | 121 | 2 | zend_execute_internal = fuzzer_execute_internal; | 122 | 2 | orig_compile_string = zend_compile_string; | 123 | 2 | zend_compile_string = fuzzer_compile_string; | 124 | 2 | } |
fuzzer-function-jit.c:fuzzer_init_php_for_execute Line | Count | Source | 108 | 2 | static void fuzzer_init_php_for_execute(const char *extra_ini) { | 109 | | /* Compilation will often trigger fatal errors. | 110 | | * Use tracked allocation mode to avoid leaks in that case. */ | 111 | 2 | putenv("USE_TRACKED_ALLOC=1"); | 112 | | | 113 | | /* Just like other SAPIs, ignore SIGPIPEs. */ | 114 | 2 | signal(SIGPIPE, SIG_IGN); | 115 | | | 116 | 2 | fuzzer_init_php(extra_ini); | 117 | | | 118 | 2 | orig_execute_ex = zend_execute_ex; | 119 | 2 | zend_execute_ex = fuzzer_execute_ex; | 120 | 2 | orig_execute_internal = zend_execute_internal ? zend_execute_internal : execute_internal; | 121 | 2 | zend_execute_internal = fuzzer_execute_internal; | 122 | 2 | orig_compile_string = zend_compile_string; | 123 | 2 | zend_compile_string = fuzzer_compile_string; | 124 | 2 | } |
fuzzer-execute.c:fuzzer_init_php_for_execute Line | Count | Source | 108 | 2 | static void fuzzer_init_php_for_execute(const char *extra_ini) { | 109 | | /* Compilation will often trigger fatal errors. | 110 | | * Use tracked allocation mode to avoid leaks in that case. */ | 111 | 2 | putenv("USE_TRACKED_ALLOC=1"); | 112 | | | 113 | | /* Just like other SAPIs, ignore SIGPIPEs. */ | 114 | 2 | signal(SIGPIPE, SIG_IGN); | 115 | | | 116 | 2 | fuzzer_init_php(extra_ini); | 117 | | | 118 | 2 | orig_execute_ex = zend_execute_ex; | 119 | 2 | zend_execute_ex = fuzzer_execute_ex; | 120 | 2 | orig_execute_internal = zend_execute_internal ? zend_execute_internal : execute_internal; | 121 | 2 | zend_execute_internal = fuzzer_execute_internal; | 122 | 2 | orig_compile_string = zend_compile_string; | 123 | 2 | zend_compile_string = fuzzer_compile_string; | 124 | 2 | } |
|
125 | | |
126 | 4 | ZEND_ATTRIBUTE_UNUSED static void create_file(void) { |
127 | | /* For opcache_invalidate() to work, the dummy file name used for fuzzing needs to |
128 | | * actually exist. */ |
129 | 4 | FILE *f = fopen(FILE_NAME, "w"); |
130 | 4 | fclose(f); |
131 | 4 | } fuzzer-tracing-jit.c:create_file Line | Count | Source | 126 | 2 | ZEND_ATTRIBUTE_UNUSED static void create_file(void) { | 127 | | /* For opcache_invalidate() to work, the dummy file name used for fuzzing needs to | 128 | | * actually exist. */ | 129 | 2 | FILE *f = fopen(FILE_NAME, "w"); | 130 | 2 | fclose(f); | 131 | 2 | } |
fuzzer-function-jit.c:create_file Line | Count | Source | 126 | 2 | ZEND_ATTRIBUTE_UNUSED static void create_file(void) { | 127 | | /* For opcache_invalidate() to work, the dummy file name used for fuzzing needs to | 128 | | * actually exist. */ | 129 | 2 | FILE *f = fopen(FILE_NAME, "w"); | 130 | 2 | fclose(f); | 131 | 2 | } |
Unexecuted instantiation: fuzzer-execute.c:create_file |
132 | | |
133 | 44.9k | ZEND_ATTRIBUTE_UNUSED static void opcache_invalidate(void) { |
134 | 44.9k | steps_left = MAX_STEPS; |
135 | 44.9k | zend_object *exception = EG(exception); |
136 | 44.9k | EG(exception) = NULL; |
137 | 44.9k | zval retval, args[2]; |
138 | 44.9k | zend_function *fn = zend_hash_str_find_ptr(CG(function_table), ZEND_STRL("opcache_invalidate")); |
139 | 44.9k | ZEND_ASSERT(fn != NULL); |
140 | | |
141 | 44.9k | ZVAL_STRING(&args[0], FILE_NAME); |
142 | 44.9k | ZVAL_TRUE(&args[1]); |
143 | 44.9k | zend_call_known_function(fn, NULL, NULL, &retval, 2, args, NULL); |
144 | 44.9k | ZEND_ASSERT(Z_TYPE(retval) == IS_TRUE); |
145 | 44.9k | zval_ptr_dtor(&args[0]); |
146 | 44.3k | zval_ptr_dtor(&retval); |
147 | 44.3k | EG(exception) = exception; |
148 | 44.3k | } fuzzer-tracing-jit.c:opcache_invalidate Line | Count | Source | 133 | 20.9k | ZEND_ATTRIBUTE_UNUSED static void opcache_invalidate(void) { | 134 | 20.9k | steps_left = MAX_STEPS; | 135 | 20.9k | zend_object *exception = EG(exception); | 136 | 20.9k | EG(exception) = NULL; | 137 | 20.9k | zval retval, args[2]; | 138 | 20.9k | zend_function *fn = zend_hash_str_find_ptr(CG(function_table), ZEND_STRL("opcache_invalidate")); | 139 | 20.9k | ZEND_ASSERT(fn != NULL); | 140 | | | 141 | 20.9k | ZVAL_STRING(&args[0], FILE_NAME); | 142 | 20.9k | ZVAL_TRUE(&args[1]); | 143 | 20.9k | zend_call_known_function(fn, NULL, NULL, &retval, 2, args, NULL); | 144 | 20.9k | ZEND_ASSERT(Z_TYPE(retval) == IS_TRUE); | 145 | 20.9k | zval_ptr_dtor(&args[0]); | 146 | 20.5k | zval_ptr_dtor(&retval); | 147 | 20.5k | EG(exception) = exception; | 148 | 20.5k | } |
fuzzer-function-jit.c:opcache_invalidate Line | Count | Source | 133 | 24.0k | ZEND_ATTRIBUTE_UNUSED static void opcache_invalidate(void) { | 134 | 24.0k | steps_left = MAX_STEPS; | 135 | 24.0k | zend_object *exception = EG(exception); | 136 | 24.0k | EG(exception) = NULL; | 137 | 24.0k | zval retval, args[2]; | 138 | 24.0k | zend_function *fn = zend_hash_str_find_ptr(CG(function_table), ZEND_STRL("opcache_invalidate")); | 139 | 24.0k | ZEND_ASSERT(fn != NULL); | 140 | | | 141 | 24.0k | ZVAL_STRING(&args[0], FILE_NAME); | 142 | 24.0k | ZVAL_TRUE(&args[1]); | 143 | 24.0k | zend_call_known_function(fn, NULL, NULL, &retval, 2, args, NULL); | 144 | 24.0k | ZEND_ASSERT(Z_TYPE(retval) == IS_TRUE); | 145 | 24.0k | zval_ptr_dtor(&args[0]); | 146 | 23.7k | zval_ptr_dtor(&retval); | 147 | 23.7k | EG(exception) = exception; | 148 | 23.7k | } |
Unexecuted instantiation: fuzzer-execute.c:opcache_invalidate |
149 | | |
150 | 44.9k | ZEND_ATTRIBUTE_UNUSED static void set_jit_option(zend_string *jit_option, const char *value) { |
151 | 44.9k | if (zend_alter_ini_entry_chars( |
152 | 44.9k | jit_option, value, strlen(value), PHP_INI_USER, PHP_INI_STAGE_RUNTIME) == FAILURE) { |
153 | | /* Fail loudly instead of silently fuzzing without the JIT. */ |
154 | | fprintf(stderr, "Failed to set opcache.jit=%s\n", value); |
155 | 0 | abort(); |
156 | 0 | } |
157 | 44.9k | } fuzzer-tracing-jit.c:set_jit_option Line | Count | Source | 150 | 20.9k | ZEND_ATTRIBUTE_UNUSED static void set_jit_option(zend_string *jit_option, const char *value) { | 151 | 20.9k | if (zend_alter_ini_entry_chars( | 152 | 20.9k | jit_option, value, strlen(value), PHP_INI_USER, PHP_INI_STAGE_RUNTIME) == FAILURE) { | 153 | | /* Fail loudly instead of silently fuzzing without the JIT. */ | 154 | | fprintf(stderr, "Failed to set opcache.jit=%s\n", value); | 155 | 0 | abort(); | 156 | 0 | } | 157 | 20.9k | } |
fuzzer-function-jit.c:set_jit_option Line | Count | Source | 150 | 24.0k | ZEND_ATTRIBUTE_UNUSED static void set_jit_option(zend_string *jit_option, const char *value) { | 151 | 24.0k | if (zend_alter_ini_entry_chars( | 152 | 24.0k | jit_option, value, strlen(value), PHP_INI_USER, PHP_INI_STAGE_RUNTIME) == FAILURE) { | 153 | | /* Fail loudly instead of silently fuzzing without the JIT. */ | 154 | | fprintf(stderr, "Failed to set opcache.jit=%s\n", value); | 155 | 0 | abort(); | 156 | 0 | } | 157 | 24.0k | } |
Unexecuted instantiation: fuzzer-execute.c:set_jit_option |