Lines Matching refs:value

25  * calculate the __cfi_check() of the target dso, and call it. So use CFI shadow and shadow value to store the
27 * values. Shadow value is used to store the relationship. A shadow value can map 1 LIBRARY_ALIGNMENT memory range. So
30 * There are 3 types for shadow value:
34 * The valid shadow value records the distance from the end of a LIBRARY_ALIGNMENT memory range to the __cfi_check addr
36 * The valid shadow value is calculated as below:
40 * + 2 : to avoid conflict with invalid and uncheck shadow value.
63 * - First align up the target addr with LIBRARY_ALIGNMENT to locate the corresponding shadow value.
98 /* Shadow value */
99 /* The related shadow value(s) will be set to `sv_invalid` when:
103 /* The related shadow value(s) will be set to `sv_uncheck` if:
106 * its shadow value will be set to `sv_uncheck`. */
108 /* If a DSO enabled CFI Cross-Dso, the DSO's shadow value should be valid. Because of the defination of `sv_invalid`
109 * and `sv_unchecked`, the valid shadow value should be at least 2. */
132 * Shift left 1 bit because the shadow value is uint16_t. */
176 static uintptr_t get_cfi_check_addr(uint16_t value, void* func_ptr)
182 uintptr_t cfi_check_func_addr = aligned_addr - ((uintptr_t)(value - sv_valid_min) << cfi_check_granularity);
195 uint16_t value = sv_invalid;
209 /* Get shadow value */
218 LD_LOGE("[CFI] set value to sv_invalid because offset(%{public}x) > shadow_size(%{public}x), "
221 value = sv_invalid;
223 value = *((uint16_t*)(cfi_shadow_start + offset));
225 LD_LOGD("[CFI] [%{public}s] called from %{public}s to %{public}s func_ptr:0x%{public}p shadow value:%{public}d diag_data:0x%{public}p call_site_type_id[%{public}p.\n",
229 func_ptr, value, diag_data, call_site_type_id);
232 switch (value)
236 // there will be potential to get to the wrong shadow value, For example:
238 // then they will use the same shadow, the shadow value will be set to invalid If this so is unloaded later,
239 // and then call the address in the kernel mapped so will get an invalid shadow value.
246 LD_LOGE("[CFI] Invalid shadow value of address:%{public}p, lr:%{public}p.\n",
269 ((cfi_check_t)get_cfi_check_addr(value, func_ptr))(call_site_type_id, func_ptr, diag_data);
363 /* Set the dso's shadow value as invalid. */
376 * value is uint16_t. The size passed to mmap() should be aligned with 4096, so shadow_size should be aligned. */
409 /* If the dso doesn't have __cfi_check(), set it's shadow value unchecked. */
425 /* If the dso has __cfi_check(), set it's shadow value valid. */
475 /* To ensure the atomicity of the CFI shadow operation, we create a temp_shadow, write the shadow value to
502 // We need to copy the whole area because we will read the old value below.
509 /* If the dso has __cfi_check(), calculate valid shadow value */