Skip to content

Commit f3ad7f8

Browse files
committed
rtld caprelocs: Derive read-only capabilities from the data capability
Eventually lld will restrict PT_CHERI_PCC to only cover sections accessed directly via PCC in which case symbols in some read-only sections may lie outside the bounds of PCC. To prepare for this, derive read-only capabilities from a capability that spans the entire object.
1 parent 89a9fb8 commit f3ad7f8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libexec/rtld-elf/cheri/cheri_reloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ process___cap_relocs(Obj_Entry *obj)
104104
can_set_bounds = tight_pcc_bounds;
105105
} else if (reloc->permissions == constant_reloc_flag) {
106106
/* read-only data pointer */
107-
cap = (uintcap_t)pcc_cap(obj, reloc->object);
107+
cap = (uintcap_t)data_base + reloc->object;
108108
cap = cheri_clearperm(cap, FUNC_PTR_REMOVE_PERMS);
109109
cap = cheri_clearperm(cap, DATA_PTR_REMOVE_PERMS);
110110
} else if (reloc->permissions == 0) {

0 commit comments

Comments
 (0)