From fa23a8a18fc56481a4ec84cbad937f68e9948306 Mon Sep 17 00:00:00 2001 From: officeyutong Date: Sat, 8 Jun 2024 16:02:10 +0800 Subject: [PATCH] update --- .github/workflows/run-execution-context-tests.yml | 4 ++-- .github/workflows/{eun-vm-tests.yml => run-vm-tests.yml} | 2 +- src/libebpf_vm.c | 2 +- vm-test/test-cases/err-stack-oob.data | 2 +- vm-test/test_runner/test_runner.c | 1 - 5 files changed, 5 insertions(+), 6 deletions(-) rename .github/workflows/{eun-vm-tests.yml => run-vm-tests.yml} (99%) diff --git a/.github/workflows/run-execution-context-tests.yml b/.github/workflows/run-execution-context-tests.yml index 756afda..85e89ce 100644 --- a/.github/workflows/run-execution-context-tests.yml +++ b/.github/workflows/run-execution-context-tests.yml @@ -6,12 +6,12 @@ on: pull_request: branches: "master" workflow_dispatch: - + concurrency: group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} cancel-in-progress: true jobs: - build: + test: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/eun-vm-tests.yml b/.github/workflows/run-vm-tests.yml similarity index 99% rename from .github/workflows/eun-vm-tests.yml rename to .github/workflows/run-vm-tests.yml index b4e6bde..d7c6721 100644 --- a/.github/workflows/eun-vm-tests.yml +++ b/.github/workflows/run-vm-tests.yml @@ -11,7 +11,7 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} cancel-in-progress: true jobs: - build: + test: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v2 diff --git a/src/libebpf_vm.c b/src/libebpf_vm.c index 4fab41e..92f80a7 100644 --- a/src/libebpf_vm.c +++ b/src/libebpf_vm.c @@ -23,7 +23,7 @@ static inline bool ebpf_runtime_bound_check(const struct ebpf_vm *vm, void *addr } else if (addr >= stack && ((char *)addr + size) <= ((char *)stack + EBPF_STACK_SIZE)) { return true; } else { - ebpf_set_error_string("ebpf error: out of bounds memory %s at PC %u, addr %p, size %d\nmem %p/%zd stack %p/%d\n", type, cur_pc, addr, size, + ebpf_set_error_string("ebpf error: out of bounds memory %s at PC %u, addr %p, size %d, mem %p/%zd stack %p/%d", type, cur_pc, addr, size, mem, mem_len, stack, EBPF_STACK_SIZE); return false; } diff --git a/vm-test/test-cases/err-stack-oob.data b/vm-test/test-cases/err-stack-oob.data index 5ecd871..ca16714 100644 --- a/vm-test/test-cases/err-stack-oob.data +++ b/vm-test/test-cases/err-stack-oob.data @@ -2,7 +2,7 @@ stb [r10], 0 exit -- error pattern -ebpf error: out of bounds memory store at PC 0, addr .*, size 1 +ebpf error: out of bounds memory store at PC 0, addr .*, size 1, mem .* stack .* -- result 0xffffffffffffffff -- no jit diff --git a/vm-test/test_runner/test_runner.c b/vm-test/test_runner/test_runner.c index 5c64d19..5fb85fa 100644 --- a/vm-test/test_runner/test_runner.c +++ b/vm-test/test_runner/test_runner.c @@ -174,7 +174,6 @@ int main(int argc, char **argv) { if (ebpf_vm_run(vm, mem, mem_len, &ret) < 0) { ret = UINT64_MAX; fprintf(stderr, "%s", ebpf_error_string()); - return 1; } }