Skip to content

Commit 127c345

Browse files
committed
nts
1 parent 1132b08 commit 127c345

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

frida_mode/src/instrument/instrument_arm32.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ static GHashTable *coverage_blocks = NULL;
1515

1616
extern __thread guint64 instrument_previous_pc;
1717

18-
__attribute__((aligned(0x1000))) static guint8 area_ptr_dummy[2UL << 20];
18+
__attribute__((aligned(0x1000))) static guint8 area_ptr_dummy[MAP_INITIAL_SIZE];
1919

2020
#pragma pack(push, 1)
2121
typedef struct {

frida_mode/src/instrument/instrument_arm64.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ gboolean instrument_cache_enabled = FALSE;
2222
gsize instrument_cache_size = 0;
2323
static GHashTable *coverage_blocks = NULL;
2424

25-
__attribute__((aligned(0x1000))) static guint8 area_ptr_dummy[2UL << 20];
25+
__attribute__((aligned(0x1000))) static guint8 area_ptr_dummy[MAP_INITIAL_SIZE];
2626

2727
#pragma pack(push, 1)
2828
typedef struct {

include/config.h

+8
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,15 @@
446446
after changing this - otherwise, SEGVs may ensue. */
447447

448448
#define MAP_SIZE_POW2 16
449+
450+
/* Do not change this unless you really know what you are doing. */
451+
449452
#define MAP_SIZE (1U << MAP_SIZE_POW2)
453+
#if MAP_SIZE <= 65536
454+
#define MAP_INITIAL_SIZE (2 << 20) // = 2097152
455+
#else
456+
#define MAP_INITIAL_SIZE MAP_SIZE
457+
#endif
450458

451459
/* Maximum allocator request size (keep well under INT_MAX): */
452460

instrumentation/SanitizerCoveragePCGUARD.so.cc

+1
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ llvmGetPassPluginInfo() {
227227

228228
PreservedAnalyses ModuleSanitizerCoverageAFL::run(Module &M,
229229
ModuleAnalysisManager &MAM) {
230+
230231
ModuleSanitizerCoverageAFL ModuleSancov(Options);
231232
auto &FAM = MAM.getResult<FunctionAnalysisManagerModuleProxy>(M).getManager();
232233
auto DTCallback = [&FAM](Function &F) -> const DominatorTree *{

instrumentation/afl-compiler-rt.o.c

-6
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,6 @@
8787
is used for instrumentation output before __afl_map_shm() has a chance to
8888
run. It will end up as .comm, so it shouldn't be too wasteful. */
8989

90-
#if MAP_SIZE <= 65536
91-
#define MAP_INITIAL_SIZE 2097152
92-
#else
93-
#define MAP_INITIAL_SIZE MAP_SIZE
94-
#endif
95-
9690
#if defined(__HAIKU__)
9791
extern ssize_t _kern_write(int fd, off_t pos, const void *buffer,
9892
size_t bufferSize);

0 commit comments

Comments
 (0)