iovisor/ubpf

ubpf_exec uses 1112 bytes of stack space - Consider moving some data to heap.

Alan-Jowett opened this issue · 0 comments

https://github.com/microsoft/ebpf-for-windows/actions/runs/5247609839/jobs/9477994065?pr=2589#step:16:6047

The ubpf_exec function now allocated the following on the stack:

    uint16_t pc = 0;
    const struct ebpf_inst* insts = vm->insts;
    uint64_t* reg;
    uint64_t _reg[16];
    uint64_t stack[(UBPF_STACK_SIZE + 7) / 8];
    struct ubpf_stack_frame stack_frames[UBPF_MAX_CALL_DEPTH] = {
        0,
    };
    uint64_t ras_index = 0;

This causes static analysis tools to issue a warning when the code is compiled for Windows kernel mode as stack space in kernel is more limited.