Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/github_actions/github/codeql-acti…
Browse files Browse the repository at this point in the history
…on-2.21.2
  • Loading branch information
Alan-Jowett committed Jul 31, 2023
2 parents a579a51 + 45e3913 commit 437796d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 1 addition & 3 deletions cmake/options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@
if(PLATFORM_LINUX OR PLATFORM_MACOS)
option(UBPF_ENABLE_COVERAGE "Set to true to enable coverage flags")
option(UBPF_ENABLE_SANITIZERS "Set to true to enable the address and undefined sanitizers")
option(UBPF_DISABLE_RETPOLINES "Disable retpoline security on indirect calls and jumps")
else()
option(UBPF_DISABLE_RETPOLINES "Disable retpoline security on indirect calls and jumps" ON)
endif()

option(UBPF_DISABLE_RETPOLINES "Disable retpoline security on indirect calls and jumps")
option(UBPF_ENABLE_INSTALL "Set to true to enable the install targets")
option(UBPF_ENABLE_TESTS "Set to true to enable tests")
option(UBPF_ENABLE_PACKAGE "Set to true to enable packaging")
Expand Down
9 changes: 9 additions & 0 deletions vm/ubpf_jit_x86_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,22 @@ emit_retpoline(struct jit_state* state)
/* label2: */
/* call label0 */
uint32_t label2 = state->offset;
#if defined(_WIN32)
/*
* Make sure that *every* call in Windows has the home space.
*/
emit_alu64_imm32(state, 0x81, 5, RSP, 4 * sizeof(uint64_t));
#endif
emit1(state, 0xe8);
emit_jump_target_offset(state, state->offset, label0);
emit4(state, 0x00);

/*
* Before leaving this mini-function, restore the proper alignment (see above).
*/
#if defined(_WIN32)
emit_alu64_imm32(state, 0x81, 0, RSP, 4 * sizeof(uint64_t));
#endif
emit_alu64_imm32(state, 0x81, 0, RSP, sizeof(uint64_t));
emit_ret(state);

Expand Down

0 comments on commit 437796d

Please sign in to comment.