search for: all_ones_mask

Displaying 4 results from an estimated 4 matches for "all_ones_mask".

2019 Sep 16
2
Spectre V1 Mitigation - Internals?
...Example: void leak(int data);void example(int* pointer1, int* pointer2) { if (condition) leak(*pointer1); else leak(*pointer2);} After the applying the mitigation the code resembles like: void leak(int data); void example(int* pointer1, int* pointer2) { uintptr_t predicate_state = all_ones_mask; if (condition) { predicate_state = !condition ? all_zeros_mask : predicate_state; pointer1 &= predicate_state; leak(*pointer1); } else { int value2 = *pointer2 & predicate_state; leak(value2); } } Let's assume that the branch is mispredicted and if body is ta...
2019 Sep 17
2
Spectre V1 Mitigation - Internals?
...f (condition) >> leak(*pointer1); >> else >> leak(*pointer2);} >> >> After the applying the mitigation the code resembles like: >> >> void leak(int data); >> void example(int* pointer1, int* pointer2) { >> uintptr_t predicate_state = all_ones_mask; >> if (condition) { >> predicate_state = !condition ? all_zeros_mask : predicate_state; >> pointer1 &= predicate_state; >> leak(*pointer1); >> } else { >> int value2 = *pointer2 & predicate_state; >> leak(value2); >>...
2019 Sep 17
2
Spectre V1 Mitigation - Internals?
...lse >>>> leak(*pointer2);} >>>> >>>> After the applying the mitigation the code resembles like: >>>> >>>> void leak(int data); >>>> void example(int* pointer1, int* pointer2) { >>>> uintptr_t predicate_state = all_ones_mask; >>>> if (condition) { >>>> predicate_state = !condition ? all_zeros_mask : predicate_state; >>>> pointer1 &= predicate_state; >>>> leak(*pointer1); >>>> } else { >>>> int value2 = *pointer2 & predic...
2018 Mar 23
5
RFC: Speculative Load Hardening (a Spectre variant #1 mitigation)
...alid loads: ``` void leak(int data); void example(int* pointer1, int* pointer2) { if (condition) { // ... lots of code ... leak(*pointer1); } else { // ... more code ... leak(*pointer2); } } ``` This would get transformed into something resembling the following: ``` uintptr_t all_ones_mask = std::numerical_limits<uintptr_t>::max(); uintptr_t all_zeros_mask = 0; void leak(int data); void example(int* pointer1, int* pointer2) { uintptr_t predicate_state = all_ones_mask; if (condition) { predicate_state = !condition ? all_zeros_mask : predicate_state; // ... lots of co...