Line data Source code
1 : #include "fd_instr_harness.h"
2 : #include "fd_solfuzz_private.h"
3 : #include "../fd_executor.h"
4 : #include "../fd_runtime.h"
5 : #include "../fd_system_ids.h"
6 : #include "../../log_collector/fd_log_collector.h"
7 : #include "../program/fd_bpf_loader_serialization.h"
8 : #include "../../../ballet/sbpf/fd_sbpf_loader.h"
9 : #include "../../vm/fd_vm.h"
10 : #include "../../vm/fd_vm_private.h"
11 : #include "generated/vm.pb.h"
12 : #include "generated/vm_serialization.pb.h"
13 : #include "../fd_bank.h"
14 :
15 : static fd_sbpf_syscalls_t *
16 : fd_solfuzz_vm_syscall_lookup_func( fd_sbpf_syscalls_t * syscalls,
17 : const char * syscall_name,
18 7552 : size_t len) {
19 7552 : ulong i;
20 :
21 7552 : if (!syscall_name) return NULL;
22 :
23 301013 : for (i = 0; i < fd_sbpf_syscalls_slot_cnt(); ++i) {
24 300994 : if (!fd_sbpf_syscalls_key_inval(syscalls[i].key) && syscalls[i].name && strlen(syscalls[i].name) == len) {
25 11111 : if (!memcmp(syscalls[i].name, syscall_name, len)) {
26 7533 : return syscalls + i;
27 7533 : }
28 11111 : }
29 300994 : }
30 :
31 19 : return NULL;
32 7552 : }
33 :
34 : static ulong
35 : fd_solfuzz_vm_load_from_input_regions( fd_vm_input_region_t const * input,
36 : uint input_count,
37 : fd_exec_test_input_data_region_t ** output,
38 : uint * output_count,
39 : void * output_buf,
40 5181 : ulong output_bufsz ) {
41 : /* Each region emits a fixed-size record holding a hash of its contents,
42 : so the output size depends on the region count, not their contents. */
43 5181 : ulong output_sz = input_count * sizeof(fd_exec_test_input_data_region_t)
44 5181 : + alignof(fd_exec_test_input_data_region_t);
45 :
46 5181 : if( FD_UNLIKELY( !input_count || output_bufsz < output_sz ) ) {
47 0 : *output = NULL;
48 0 : *output_count = 0;
49 0 : return 0;
50 0 : }
51 :
52 5181 : FD_SCRATCH_ALLOC_INIT( l, output_buf );
53 5181 : *output = FD_SCRATCH_ALLOC_APPEND( l, alignof(fd_exec_test_input_data_region_t),
54 5181 : input_count * sizeof (fd_exec_test_input_data_region_t) );
55 5181 : FD_TEST( *output );
56 5181 : *output_count = input_count;
57 :
58 15944 : for( ulong i=0; i<input_count; i++ ) {
59 10763 : fd_vm_input_region_t const * vm_region = &input[i];
60 10763 : fd_exec_test_input_data_region_t * out_region = &(*output)[i];
61 10763 : out_region->is_writable = vm_region->is_writable;
62 10763 : out_region->offset = vm_region->vaddr_offset;
63 :
64 10763 : out_region->content_hash = fd_solfuzz_hash( (void *)vm_region->haddr, vm_region->region_sz );
65 10763 : }
66 :
67 5181 : ulong end = FD_SCRATCH_ALLOC_FINI( l, 1UL );
68 5181 : return end - (ulong)output_buf; /* return the number of bytes written */
69 5181 : }
70 :
71 :
72 : ulong
73 : fd_solfuzz_pb_syscall_run( fd_solfuzz_runner_t * runner,
74 : void const * input_,
75 : void ** output_,
76 : void * output_buf,
77 7555 : ulong output_bufsz ) {
78 7555 : fd_exec_test_syscall_context_t const * input = fd_type_pun_const( input_ );
79 7555 : fd_exec_test_syscall_effects_t ** output = fd_type_pun( output_ );
80 :
81 : /* Create execution context */
82 7555 : const fd_exec_test_instr_context_t * input_instr_ctx = &input->instr_ctx;
83 7555 : fd_exec_instr_ctx_t ctx[1];
84 7555 : fd_solfuzz_pb_instr_ctx_create( runner, ctx, input_instr_ctx );
85 7555 : ulong frame_level = ULONG_MAX;
86 :
87 7555 : ctx->txn_out->err.exec_err = 0;
88 7555 : ctx->txn_out->err.exec_err_kind = FD_EXECUTOR_ERR_KIND_NONE;
89 7555 : ctx->bank = runner->bank;
90 :
91 : /* Capture outputs */
92 7555 : ulong output_end = (ulong)output_buf + output_bufsz;
93 7555 : FD_SCRATCH_ALLOC_INIT( l, output_buf );
94 7555 : fd_exec_test_syscall_effects_t * effects =
95 7555 : FD_SCRATCH_ALLOC_APPEND( l, alignof(fd_exec_test_syscall_effects_t),
96 7555 : sizeof (fd_exec_test_syscall_effects_t) );
97 7555 : if( FD_UNLIKELY( _l > output_end ) ) {
98 0 : goto error;
99 0 : }
100 :
101 7555 : if( input->vm_ctx.return_data.program_id && input->vm_ctx.return_data.program_id->size == sizeof(fd_pubkey_t) ) {
102 1905 : fd_memcpy( ctx->txn_out->details.return_data.program_id.uc, input->vm_ctx.return_data.program_id->bytes, sizeof(fd_pubkey_t) );
103 1905 : }
104 :
105 7555 : if( input->vm_ctx.return_data.data && input->vm_ctx.return_data.data->size>0U ) {
106 1286 : if( FD_UNLIKELY( input->vm_ctx.return_data.data->size>sizeof(ctx->txn_out->details.return_data.data) ) ) goto error;
107 1286 : ctx->txn_out->details.return_data.len = input->vm_ctx.return_data.data->size;
108 1286 : fd_memcpy( ctx->txn_out->details.return_data.data, input->vm_ctx.return_data.data->bytes, ctx->txn_out->details.return_data.len );
109 1286 : }
110 :
111 7555 : *effects = (fd_exec_test_syscall_effects_t){0};
112 :
113 : /* Set up the VM instance */
114 7555 : fd_spad_t * spad = runner->spad;
115 7555 : fd_sha256_t _sha[1];
116 7555 : fd_sha256_t * sha = fd_sha256_join( fd_sha256_new( _sha ) );
117 7555 : fd_sbpf_syscalls_t * syscalls = fd_sbpf_syscalls_new( fd_spad_alloc_check( spad, fd_sbpf_syscalls_align(), fd_sbpf_syscalls_footprint() ) );
118 7555 : fd_vm_syscall_register_all( syscalls, 0 );
119 :
120 : /* Pull out the memory regions */
121 7555 : if( !input->has_vm_ctx ) {
122 0 : goto error;
123 0 : }
124 :
125 7555 : ulong rodata_sz = input->vm_ctx.rodata ? input->vm_ctx.rodata->size : 0UL;
126 7555 : uchar * rodata = fd_spad_alloc_check( spad, 8UL, rodata_sz );
127 7555 : if ( input->vm_ctx.rodata != NULL ) {
128 4077 : fd_memcpy( rodata, input->vm_ctx.rodata->bytes, rodata_sz );
129 4077 : }
130 :
131 7555 : if( input->vm_ctx.heap_max > FD_VM_HEAP_MAX ) {
132 0 : goto error;
133 0 : }
134 :
135 7555 : FD_TEST( input->vm_ctx.sbpf_version<=FD_SBPF_V3 );
136 :
137 7555 : fd_vm_t * vm = fd_vm_join( fd_vm_new( fd_spad_alloc_check( spad, fd_vm_align(), fd_vm_footprint() ) ) );
138 7555 : if ( !vm ) {
139 0 : goto error;
140 0 : }
141 :
142 : /* If the program ID account owner is the v1 BPF loader, then alignment is disabled (controlled by
143 : the `is_deprecated` flag) */
144 :
145 7555 : ulong input_sz = 0UL;
146 7555 : ulong pre_lens[256] = {0};
147 7555 : fd_vm_input_region_t input_mem_regions[1000] = {0}; /* We can have a max of (3 * num accounts + 1) regions */
148 7555 : fd_vm_acc_region_meta_t acc_region_metas[256] = {0}; /* instr acc idx to idx */
149 7555 : uint input_mem_regions_cnt = 0U;
150 7555 : int direct_account_pointers_in_program_input = FD_FEATURE_ACTIVE_BANK( ctx->bank, direct_account_pointers_in_program_input );
151 :
152 7555 : uchar program_id_idx = ctx->instr->program_id;
153 7555 : fd_acc_t * program_acc = ctx->txn_out->accounts.account[program_id_idx];
154 7555 : uchar is_deprecated = ( program_id_idx < ctx->txn_out->accounts.cnt ) &&
155 7570 : ( !memcmp( program_acc->owner, fd_solana_bpf_loader_deprecated_program_id.key, sizeof(fd_pubkey_t) ) );
156 :
157 : /* Push the instruction onto the stack. This may also modify the sysvar instructions account, if its present. */
158 7555 : int stack_push_err = fd_instr_stack_push( ctx->runtime, ctx->bank, ctx->txn_in, ctx->txn_out, (fd_instr_info_t *)ctx->instr );
159 7555 : if( FD_UNLIKELY( stack_push_err ) ) {
160 0 : FD_LOG_WARNING(( "instr stack push err" ));
161 0 : goto error;
162 0 : }
163 7555 : frame_level = ctx->runtime->instr.stack_sz-1UL;
164 7555 : ctx->runtime->bpf_loader_serialization.frame[ frame_level ] = fd_bpf_frames_acquire( ctx->runtime->bpf_frames, 0 );
165 :
166 7555 : ulong instr_data_offset = 0UL;
167 7555 : ulong account_pointers_offset = 0UL;
168 7555 : int err = fd_bpf_loader_input_serialize_parameters( ctx,
169 7555 : pre_lens,
170 7555 : input_mem_regions,
171 7555 : &input_mem_regions_cnt,
172 7555 : acc_region_metas,
173 7555 : direct_account_pointers_in_program_input,
174 7555 : is_deprecated,
175 7555 : &instr_data_offset,
176 7555 : &account_pointers_offset,
177 7555 : &input_sz );
178 7555 : if( FD_UNLIKELY( err ) ) {
179 0 : FD_LOG_WARNING(( "bpf loader input serialize parameters err" ));
180 0 : goto error;
181 0 : }
182 :
183 7555 : fd_vm_init( vm,
184 7555 : ctx,
185 7555 : input->vm_ctx.heap_max,
186 7555 : ctx->txn_out->details.compute_budget.compute_meter,
187 7555 : rodata,
188 7555 : rodata_sz,
189 7555 : NULL, // TODO
190 7555 : 0, // TODO
191 7555 : 0, // TODO
192 7555 : 0, // TODO, text_sz
193 7555 : 0, // TODO
194 7555 : NULL, // TODO
195 7555 : input->vm_ctx.sbpf_version,
196 7555 : syscalls,
197 7555 : NULL, // TODO
198 7555 : sha,
199 7555 : input_mem_regions,
200 7555 : input_mem_regions_cnt,
201 7555 : acc_region_metas,
202 7555 : is_deprecated,
203 7555 : 0 /* dump_syscall_to_pb */,
204 7555 : (ulong[ FD_VM_REG_CNT ]){ 0 } /* r2 is set by the fuzzer below */ );
205 :
206 : // Override some execution state values from the syscall fuzzer input
207 : // This is so we can test if the syscall mutates any of these erroneously
208 7555 : vm->reg[0] = input->vm_ctx.r0;
209 7555 : vm->reg[1] = input->vm_ctx.r1;
210 7555 : vm->reg[2] = input->vm_ctx.r2;
211 7555 : vm->reg[3] = input->vm_ctx.r3;
212 7555 : vm->reg[4] = input->vm_ctx.r4;
213 7555 : vm->reg[5] = input->vm_ctx.r5;
214 7555 : vm->reg[6] = input->vm_ctx.r6;
215 7555 : vm->reg[7] = input->vm_ctx.r7;
216 7555 : vm->reg[8] = input->vm_ctx.r8;
217 7555 : vm->reg[9] = input->vm_ctx.r9;
218 7555 : vm->reg[10] = input->vm_ctx.r10;
219 7555 : vm->reg[11] = input->vm_ctx.r11;
220 :
221 7555 : fd_vm_mem_init_full( vm );
222 :
223 : // Override initial part of the heap, if specified the syscall fuzzer input
224 7555 : if( input->syscall_invocation.heap_prefix ) {
225 6585 : fd_memcpy( vm->heap, input->syscall_invocation.heap_prefix->bytes,
226 6585 : fd_ulong_min( input->syscall_invocation.heap_prefix->size, vm->heap_max ) );
227 6585 : }
228 :
229 : // Override initial part of the stack, if specified the syscall fuzzer input
230 7555 : if( input->syscall_invocation.stack_prefix ) {
231 3146 : fd_memcpy( vm->stack, input->syscall_invocation.stack_prefix->bytes,
232 3146 : fd_ulong_min( input->syscall_invocation.stack_prefix->size, FD_VM_STACK_MAX ) );
233 3146 : }
234 :
235 : // Look up the syscall to execute
236 7555 : char * syscall_name = (char *)input->syscall_invocation.function_name.bytes;
237 7555 : fd_sbpf_syscalls_t const * syscall = fd_solfuzz_vm_syscall_lookup_func(syscalls, syscall_name, input->syscall_invocation.function_name.size);
238 7555 : if( !syscall ) {
239 0 : goto error;
240 0 : }
241 :
242 : /* There's an instr ctx struct embedded in the txn ctx instr stack. */
243 7555 : fd_exec_instr_ctx_t * instr_ctx = &ctx->runtime->instr.stack[ ctx->runtime->instr.stack_sz - 1 ];
244 7555 : *instr_ctx = (fd_exec_instr_ctx_t) {
245 7555 : .instr = ctx->instr,
246 7555 : .txn_out = ctx->txn_out,
247 7555 : .runtime = ctx->runtime,
248 7555 : };
249 :
250 : /* Actually invoke the syscall */
251 7555 : int syscall_err = syscall->func( vm, vm->reg[1], vm->reg[2], vm->reg[3], vm->reg[4], vm->reg[5] );
252 7555 : int instr_end_err = fd_execute_instr_end( vm->instr_ctx, ctx->instr, syscall_err );
253 7555 : if( instr_end_err ) {
254 2387 : fd_log_collector_program_failure( vm->instr_ctx );
255 2387 : }
256 :
257 : /* Capture the effects */
258 7555 : int exec_err = vm->instr_ctx->txn_out->err.exec_err;
259 7555 : effects->error = 0;
260 7555 : if( instr_end_err ) {
261 2387 : if( exec_err==0 ) {
262 0 : FD_LOG_WARNING(( "TODO: syscall returns error, but exec_err not set. this is probably missing a log." ));
263 0 : effects->error = -1;
264 2387 : } else {
265 2387 : effects->error = (exec_err <= 0) ? -exec_err : -1;
266 :
267 : /* Map error kind, equivalent to:
268 : effects->error_kind = (fd_exec_test_err_kind_t)(vm->instr_ctx->txn_ctx->err.exec_err_kind); */
269 2387 : switch (vm->instr_ctx->txn_out->err.exec_err_kind) {
270 1370 : case FD_EXECUTOR_ERR_KIND_EBPF:
271 1370 : effects->error_kind = FD_EXEC_TEST_ERR_KIND_EBPF;
272 1370 : break;
273 399 : case FD_EXECUTOR_ERR_KIND_SYSCALL:
274 399 : effects->error_kind = FD_EXEC_TEST_ERR_KIND_SYSCALL;
275 399 : break;
276 618 : case FD_EXECUTOR_ERR_KIND_INSTR:
277 618 : effects->error_kind = FD_EXEC_TEST_ERR_KIND_INSTRUCTION;
278 618 : break;
279 0 : default:
280 0 : effects->error_kind = FD_EXEC_TEST_ERR_KIND_UNSPECIFIED;
281 0 : break;
282 2387 : }
283 2387 : }
284 2387 : }
285 7555 : effects->r0 = instr_end_err ? 0 : vm->reg[0]; // Save only on success
286 7555 : effects->cu_avail = (ulong)vm->cu;
287 :
288 7555 : effects->heap_hash = fd_solfuzz_hash( vm->heap, vm->heap_max );
289 7555 : effects->stack_hash = fd_solfuzz_hash( vm->stack, FD_VM_STACK_MAX );
290 7555 : effects->rodata_hash = fd_solfuzz_hash( vm->rodata, vm->rodata_sz ? rodata_sz : 0UL );
291 :
292 7555 : effects->frame_count = vm->frame_cnt;
293 :
294 : /* Capture input regions */
295 7555 : ulong tmp_end = FD_SCRATCH_ALLOC_FINI( l, 1UL );
296 :
297 : /* Skip comparing input data regions if execution failed, because
298 : Agave leaks data into the input regions under these circumstances. */
299 7555 : ulong input_regions_size = 0UL;
300 7555 : if( syscall_err ) {
301 2387 : effects->input_data_regions = NULL;
302 2387 : effects->input_data_regions_count = 0UL;
303 5168 : } else {
304 5168 : input_regions_size = fd_solfuzz_vm_load_from_input_regions(
305 5168 : vm->input_mem_regions,
306 5168 : vm->input_mem_regions_cnt,
307 5168 : &effects->input_data_regions,
308 5168 : &effects->input_data_regions_count,
309 5168 : (void *)tmp_end,
310 5168 : fd_ulong_sat_sub( output_end, tmp_end )
311 5168 : );
312 :
313 5177 : if( !!vm->input_mem_regions_cnt && !effects->input_data_regions ) {
314 0 : goto error;
315 0 : }
316 5168 : }
317 :
318 : /* Return the effects */
319 7555 : ulong actual_end = tmp_end + input_regions_size;
320 7555 : fd_bpf_frames_release( ctx->runtime->bpf_frames, ctx->runtime->bpf_loader_serialization.frame[ frame_level ] );
321 7555 : fd_solfuzz_pb_instr_ctx_destroy( runner, ctx );
322 :
323 7555 : *output = effects;
324 7555 : return actual_end - (ulong)output_buf;
325 :
326 0 : error:
327 0 : if( frame_level!=ULONG_MAX ) fd_bpf_frames_release( ctx->runtime->bpf_frames, ctx->runtime->bpf_loader_serialization.frame[ frame_level ] );
328 0 : fd_solfuzz_pb_instr_ctx_destroy( runner, ctx );
329 0 : return 0;
330 7555 : }
331 :
332 : ulong
333 : fd_solfuzz_pb_vm_serialize_run( fd_solfuzz_runner_t * runner,
334 : void const * input_,
335 : void ** output_,
336 : void * output_buf,
337 1000 : ulong output_bufsz ) {
338 1000 : fd_exec_test_instr_context_t const * input = fd_type_pun_const( input_ );
339 1000 : fd_exec_test_vm_serialization_effects_t ** output = fd_type_pun( output_ );
340 :
341 : /* Create execution context */
342 1000 : fd_exec_instr_ctx_t ctx[1];
343 1000 : fd_solfuzz_pb_instr_ctx_create( runner, ctx, input );
344 :
345 1000 : ctx->txn_out->err.exec_err = 0;
346 1000 : ctx->txn_out->err.exec_err_kind = FD_EXECUTOR_ERR_KIND_NONE;
347 1000 : ctx->bank = runner->bank;
348 :
349 : /* Capture outputs */
350 1000 : ulong output_end = (ulong)output_buf + output_bufsz;
351 1000 : FD_SCRATCH_ALLOC_INIT( l, output_buf );
352 1000 : fd_exec_test_vm_serialization_effects_t * effects =
353 1000 : FD_SCRATCH_ALLOC_APPEND( l, alignof(fd_exec_test_vm_serialization_effects_t),
354 1000 : sizeof (fd_exec_test_vm_serialization_effects_t) );
355 1000 : FD_TEST( _l <= output_end );
356 1000 : *effects = (fd_exec_test_vm_serialization_effects_t){0};
357 :
358 : /* Determine feature flags and is_deprecated */
359 1000 : int direct_account_pointers_in_program_input = FD_FEATURE_ACTIVE_BANK( ctx->bank, direct_account_pointers_in_program_input );
360 :
361 1000 : uchar program_id_idx = ctx->instr->program_id;
362 1000 : fd_acc_t * program_acc = ctx->txn_out->accounts.account[program_id_idx];
363 1000 : uchar is_deprecated = ( program_id_idx < ctx->txn_out->accounts.cnt ) &&
364 1000 : ( !memcmp( program_acc->owner, fd_solana_bpf_loader_deprecated_program_id.key, sizeof(fd_pubkey_t) ) );
365 :
366 : /* Push the instruction onto the stack */
367 1000 : FD_TEST( !fd_instr_stack_push( ctx->runtime, ctx->bank, ctx->txn_in, ctx->txn_out, (fd_instr_info_t *)ctx->instr ) );
368 1000 : ulong frame_level = ctx->runtime->instr.stack_sz-1UL;
369 1000 : uchar * serialized_buf = fd_bpf_frames_acquire( ctx->runtime->bpf_frames, 0 );
370 1000 : ctx->runtime->bpf_loader_serialization.frame[ frame_level ] = serialized_buf;
371 :
372 : /* Call serialize_parameters */
373 1000 : ulong input_sz = 0UL;
374 1000 : ulong pre_lens[256] = {0};
375 1000 : fd_vm_input_region_t input_mem_regions[1000] = {0};
376 1000 : fd_vm_acc_region_meta_t acc_region_metas[256] = {0};
377 1000 : uint input_mem_regions_cnt = 0U;
378 1000 : ulong instr_data_offset = 0UL;
379 1000 : ulong account_pointers_offset = 0UL;
380 :
381 1000 : int err = fd_bpf_loader_input_serialize_parameters(
382 1000 : ctx,
383 1000 : pre_lens,
384 1000 : input_mem_regions,
385 1000 : &input_mem_regions_cnt,
386 1000 : acc_region_metas,
387 1000 : direct_account_pointers_in_program_input,
388 1000 : is_deprecated,
389 1000 : &instr_data_offset,
390 1000 : &account_pointers_offset,
391 1000 : &input_sz
392 1000 : );
393 :
394 1000 : if( FD_UNLIKELY( err ) ) {
395 0 : effects->has_error = true;
396 0 : ulong actual_end = FD_SCRATCH_ALLOC_FINI( l, 1UL );
397 0 : fd_bpf_frames_release( ctx->runtime->bpf_frames, ctx->runtime->bpf_loader_serialization.frame[ frame_level ] );
398 0 : fd_solfuzz_pb_instr_ctx_destroy( runner, ctx );
399 0 : *output = effects;
400 0 : return actual_end - (ulong)output_buf;
401 0 : }
402 :
403 : /* Hash the serialized memory buffer. */
404 1000 : effects->serialized_memory_hash = fd_hash( 0UL, serialized_buf, input_sz );
405 :
406 : /* Populate vm_input_memory_regions */
407 1000 : effects->vm_input_memory_regions_count = (uint)input_mem_regions_cnt;
408 1000 : effects->vm_input_memory_regions =
409 1000 : FD_SCRATCH_ALLOC_APPEND( l, alignof(fd_exec_test_vm_input_memory_region_t),
410 1000 : input_mem_regions_cnt * sizeof(fd_exec_test_vm_input_memory_region_t) );
411 1000 : FD_TEST( _l <= output_end );
412 :
413 90528 : for( uint i=0; i<input_mem_regions_cnt; i++ ) {
414 89528 : fd_vm_input_region_t const * region = &input_mem_regions[i];
415 89528 : fd_exec_test_vm_input_memory_region_t * out = &effects->vm_input_memory_regions[i];
416 89528 : out->vm_address = FD_VM_MEM_MAP_INPUT_REGION_START + region->vaddr_offset;
417 89528 : out->region_size = region->region_sz;
418 89528 : out->is_writable = region->is_writable;
419 89528 : }
420 :
421 : /* Populate serialized_account_metadata */
422 1000 : ulong num_ix_accounts = ctx->instr->acct_cnt;
423 1000 : effects->serialized_account_metadata_count = (uint)num_ix_accounts;
424 1000 : effects->serialized_account_metadata =
425 1000 : FD_SCRATCH_ALLOC_APPEND( l, alignof(fd_exec_test_vm_serialized_account_metadata_t),
426 1000 : num_ix_accounts * sizeof(fd_exec_test_vm_serialized_account_metadata_t) );
427 1000 : FD_TEST( _l <= output_end );
428 :
429 76379 : for( ulong i=0; i<num_ix_accounts; i++ ) {
430 75379 : fd_vm_acc_region_meta_t const * meta = &acc_region_metas[i];
431 75379 : fd_exec_test_vm_serialized_account_metadata_t * out = &effects->serialized_account_metadata[i];
432 75379 : out->original_data_len = meta->original_data_len;
433 75379 : out->vm_data_addr = meta->vm_data_addr;
434 75379 : out->vm_key_addr = meta->vm_key_addr;
435 75379 : out->vm_lamports_addr = meta->vm_lamports_addr;
436 75379 : out->vm_owner_addr = meta->vm_owner_addr;
437 75379 : }
438 :
439 1000 : ulong actual_end = FD_SCRATCH_ALLOC_FINI( l, 1UL );
440 1000 : fd_bpf_frames_release( ctx->runtime->bpf_frames, ctx->runtime->bpf_loader_serialization.frame[ frame_level ] );
441 1000 : fd_solfuzz_pb_instr_ctx_destroy( runner, ctx );
442 :
443 1000 : *output = effects;
444 1000 : return actual_end - (ulong)output_buf;
445 1000 : }
|