Skip to content

Commit

Permalink
i#1900: fix page boundary bug in ARM IBL patch
Browse files Browse the repository at this point in the history
Fixes a page boundary calculation bug in the ARM version of the IBL
hashlookup_null_target patch.

Fixes #1900

Review-URL: https://codereview.appspot.com/293780043
  • Loading branch information
derekbruening committed Mar 8, 2016
1 parent 82b8f9a commit 92f54bc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/fragment.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* **********************************************************
* Copyright (c) 2011-2015 Google, Inc. All rights reserved.
* Copyright (c) 2011-2016 Google, Inc. All rights reserved.
* Copyright (c) 2000-2010 VMware, Inc. All rights reserved.
* **********************************************************/

Expand Down Expand Up @@ -788,7 +788,8 @@ hashtable_ibl_myinit(dcontext_t *dcontext, ibl_table_t *table, uint bits,
/* see comments in x86.asm: we patch to avoid text relocations */
byte *pc = (byte *) hashlookup_null_handler;
byte *page_start = (byte *) PAGE_START(pc);
byte *page_end = (byte *) ALIGN_FORWARD(pc + JMP_LONG_LENGTH, PAGE_SIZE);
byte *page_end = (byte *)
ALIGN_FORWARD(pc IF_ARM(+ ARM_INSTR_SIZE) + JMP_LONG_LENGTH, PAGE_SIZE);
make_writable(page_start, page_end - page_start);
# ifdef X86
insert_relative_target(pc + 1, hashlookup_null_target, NOT_HOT_PATCHABLE);
Expand Down

0 comments on commit 92f54bc

Please sign in to comment.