-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathredfat_config.c
492 lines (485 loc) · 18.6 KB
/
redfat_config.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
/* AUTOMATICALLY GENERATED */
#include "redfat_config.h"
#define REDFAT_NUM_REGIONS 57
#define REDFAT_SIZES_PAGES 1
#define REDFAT_REGION_SIZE _REDFAT_REGION_SIZE
#define REDFAT_REGION_SIZE_SHIFT 36
#define REDFAT_HEAP_MEMORY_SIZE 34359738368
#define REDFAT_HEAP_MEMORY_OFFSET 0
#define REDFAT_STACK_SIZE 67108864
#define REDFAT_PAGE_SIZE 4096
#define REDFAT_HEAP_ASLR_MASK 0x3FFFFFFFFull
#define REDFAT_MAX_HEAP_ALLOC_SIZE 67108864
#define REDFAT_TID_OFFSET 0x2d0
#define REDFAT_JOINID_OFFSET 0x628
__attribute__((__aligned__(REDFAT_PAGE_SIZE))) __attribute__((__section__("REDFAT_TABLES"))) const size_t __REDFAT_SIZES[512] =
{
SIZE_MAX,
32, /* idx=1 */
48, /* idx=2 */
64, /* idx=3 */
80, /* idx=4 */
96, /* idx=5 */
112, /* idx=6 */
128, /* idx=7 */
144, /* idx=8 */
160, /* idx=9 */
192, /* idx=10 */
224, /* idx=11 */
256, /* idx=12 */
288, /* idx=13 */
320, /* idx=14 */
352, /* idx=15 */
384, /* idx=16 */
416, /* idx=17 */
448, /* idx=18 */
480, /* idx=19 */
512, /* idx=20 */
544, /* idx=21 */
640, /* idx=22 */
768, /* idx=23 */
896, /* idx=24 */
1024, /* idx=25 */
1056, /* idx=26 */
1280, /* idx=27 */
1536, /* idx=28 */
1792, /* idx=29 */
2048, /* idx=30 */
2080, /* idx=31 */
2560, /* idx=32 */
3072, /* idx=33 */
3584, /* idx=34 */
4096, /* idx=35 */
4128, /* idx=36 */
5120, /* idx=37 */
6144, /* idx=38 */
7168, /* idx=39 */
8192, /* idx=40 */
8224, /* idx=41 */
10240, /* idx=42 */
12288, /* idx=43 */
14336, /* idx=44 */
16384, /* idx=45 */
32768, /* idx=46 */
65536, /* idx=47 */
131072, /* idx=48 */
262144, /* idx=49 */
524288, /* idx=50 */
1048576, /* idx=51 */
2097152, /* idx=52 */
4194304, /* idx=53 */
8388608, /* idx=54 */
16777216, /* idx=55 */
33554432, /* idx=56 */
67108864, /* idx=57 */
SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX,
SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX,
SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX,
SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX,
SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX,
SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX,
SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX,
SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX,
SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX,
SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX,
SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX,
SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX,
SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX,
SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX,
SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MA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X, SIZE_MAX, SIZE_MAX, SIZE_MAX,
SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX,
SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX,
};
__attribute__((__aligned__(REDFAT_PAGE_SIZE))) __attribute__((__section__("REDFAT_TABLES"))) const size_t __REDFAT_SIZES_MAX[512] =
{
SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX,
SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX,
SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX,
SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX,
SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX,
SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX,
SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX,
SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX,
SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX,
SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX,
SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX,
SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX,
SIZE_MAX, SIZE_MAX, SIZE_MAX,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SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX,
SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX,
SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX,
SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX,
SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX,
SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX,
SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX,
SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX,
SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX,
SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX,
SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX,
SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX,
SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX, SIZE_MAX,
SIZE_MAX,
};
__attribute__((__aligned__(REDFAT_PAGE_SIZE))) __attribute__((__section__("REDFAT_TABLES"))) const size_t __REDFAT_MAGICS[512] =
{
0,
0x0800000000000001ull, /* idx=1, size=32 */
0x0555555555555556ull, /* idx=2, size=48 */
0x0400000000000001ull, /* idx=3, size=64 */
0x0333333333333334ull, /* idx=4, size=80 */
0x02AAAAAAAAAAAAABull, /* idx=5, size=96 */
0x024924924924924Aull, /* idx=6, size=112 */
0x0200000000000001ull, /* idx=7, size=128 */
0x01C71C71C71C71C8ull, /* idx=8, size=144 */
0x019999999999999Aull, /* idx=9, size=160 */
0x0155555555555556ull, /* idx=10, size=192 */
0x0124924924924925ull, /* idx=11, size=224 */
0x0100000000000001ull, /* idx=12, size=256 */
0x00E38E38E38E38E4ull, /* idx=13, size=288 */
0x00CCCCCCCCCCCCCDull, /* idx=14, size=320 */
0x00BA2E8BA2E8BA2Full, /* idx=15, size=352 */
0x00AAAAAAAAAAAAABull, /* idx=16, size=384 */
0x009D89D89D89D89Eull, /* idx=17, size=416 */
0x0092492492492493ull, /* idx=18, size=448 */
0x0088888888888889ull, /* idx=19, size=480 */
0x0080000000000001ull, /* idx=20, size=512 */
0x0078787878787879ull, /* idx=21, size=544 */
0x0066666666666667ull, /* idx=22, size=640 */
0x0055555555555556ull, /* idx=23, size=768 */
0x004924924924924Aull, /* idx=24, size=896 */
0x0040000000000001ull, /* idx=25, size=1024 */
0x003E0F83E0F83E10ull, /* idx=26, size=1056 */
0x0033333333333334ull, /* idx=27, size=1280 */
0x002AAAAAAAAAAAABull, /* idx=28, size=1536 */
0x0024924924924925ull, /* idx=29, size=1792 */
0x0020000000000001ull, /* idx=30, size=2048 */
0x001F81F81F81F820ull, /* idx=31, size=2080 */
0x001999999999999Aull, /* idx=32, size=2560 */
0x0015555555555556ull, /* idx=33, size=3072 */
0x0012492492492493ull, /* idx=34, size=3584 */
0x0010000000000001ull, /* idx=35, size=4096 */
0x000FE03F80FE03F9ull, /* idx=36, size=4128 */
0x000CCCCCCCCCCCCDull, /* idx=37, size=5120 */
0x000AAAAAAAAAAAABull, /* idx=38, size=6144 */
0x000924924924924Aull, /* idx=39, size=7168 */
0x0008000000000001ull, /* idx=40, size=8192 */
0x0007F807F807F808ull, /* idx=41, size=8224 */
0x0006666666666667ull, /* idx=42, size=10240 */
0x0005555555555556ull, /* idx=43, size=12288 */
0x0004924924924925ull, /* idx=44, size=14336 */
0x0004000000000001ull, /* idx=45, size=16384 */
0x0002000000000001ull, /* idx=46, size=32768 */
0x0001000000000001ull, /* idx=47, size=65536 */
0x0000800000000001ull, /* idx=48, size=131072 */
0x0000400000000001ull, /* idx=49, size=262144 */
0x0000200000000001ull, /* idx=50, size=524288 */
0x0000100000000001ull, /* idx=51, size=1048576 */
0x0000080000000001ull, /* idx=52, size=2097152 */
0x0000040000000001ull, /* idx=53, size=4194304 */
0x0000020000000001ull, /* idx=54, size=8388608 */
0x0000010000000001ull, /* idx=55, size=16777216 */
0x0000008000000001ull, /* idx=56, size=33554432 */
0x0000004000000001ull, /* idx=57, size=67108864 */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
};
static size_t redfat_heap_select(size_t size)
{
switch (__builtin_clzll(size))
{
case 64:
case 63:
case 62:
case 61:
case 60:
case 59:
case 58:
if (size <= 32-1-0)
return 1;
if (size <= 48-1-0)
return 2;
case 57:
if (size <= 64-1-0)
return 3;
if (size <= 80-1-0)
return 4;
if (size <= 96-1-0)
return 5;
if (size <= 112-1-0)
return 6;
case 56:
if (size <= 128-1-0)
return 7;
if (size <= 144-1-0)
return 8;
if (size <= 160-1-0)
return 9;
if (size <= 192-1-0)
return 10;
if (size <= 224-1-0)
return 11;
case 55:
if (size <= 256-1-0)
return 12;
if (size <= 288-1-0)
return 13;
if (size <= 320-1-0)
return 14;
if (size <= 352-1-0)
return 15;
if (size <= 384-1-0)
return 16;
if (size <= 416-1-0)
return 17;
if (size <= 448-1-0)
return 18;
if (size <= 480-1-0)
return 19;
case 54:
if (size <= 512-1-0)
return 20;
if (size <= 544-1-0)
return 21;
if (size <= 640-1-0)
return 22;
if (size <= 768-1-0)
return 23;
if (size <= 896-1-0)
return 24;
case 53:
if (size <= 1024-1-0)
return 25;
if (size <= 1056-1-0)
return 26;
if (size <= 1280-1-0)
return 27;
if (size <= 1536-1-0)
return 28;
if (size <= 1792-1-0)
return 29;
case 52:
if (size <= 2048-1-0)
return 30;
if (size <= 2080-1-0)
return 31;
if (size <= 2560-1-0)
return 32;
if (size <= 3072-1-0)
return 33;
if (size <= 3584-1-0)
return 34;
case 51:
if (size <= 4096-1-0)
return 35;
if (size <= 4128-1-0)
return 36;
if (size <= 5120-1-0)
return 37;
if (size <= 6144-1-0)
return 38;
if (size <= 7168-1-0)
return 39;
case 50:
if (size <= 8192-1-0)
return 40;
if (size <= 8224-1-0)
return 41;
if (size <= 10240-1-0)
return 42;
if (size <= 12288-1-0)
return 43;
if (size <= 14336-1-0)
return 44;
case 49:
if (size <= 16384-1-0)
return 45;
case 48:
if (size <= 32768-1-0)
return 46;
case 47:
if (size <= 65536-1-0)
return 47;
case 46:
if (size <= 131072-1-0)
return 48;
case 45:
if (size <= 262144-1-0)
return 49;
case 44:
if (size <= 524288-1-0)
return 50;
case 43:
if (size <= 1048576-1-0)
return 51;
case 42:
if (size <= 2097152-1-0)
return 52;
case 41:
if (size <= 4194304-1-0)
return 53;
case 40:
if (size <= 8388608-1-1)
return 54;
case 39:
if (size <= 16777216-1-3)
return 55;
case 38:
if (size <= 33554432-1-7)
return 56;
case 37:
if (size <= 67108864-1-14)
return 57;
case 36:
case 35:
case 34:
case 33:
case 32:
case 31:
case 30:
case 29:
case 28:
case 27:
case 26:
case 25:
case 24:
case 23:
case 22:
case 21:
case 20:
case 19:
case 18:
case 17:
case 16:
case 15:
case 14:
case 13:
case 12:
case 11:
case 10:
case 9:
case 8:
case 7:
case 6:
case 5:
case 4:
case 3:
case 2:
case 1:
case 0:
default:
return 0;
}
}