HomeFreeBSD

rtld-elf: Check the return value of obj_enforce_relro()

Description

rtld-elf: Check the return value of obj_enforce_relro()

The mprotect() call was failing on CheriBSD when changing rtld's relro
page permissions due to missing CHERI capability permissions on the
mprotect() argument but did not report an error since the return value
was being ignored. It should never fail on any supported FreeBSD
architecture, but checking the return value seems like a good
sanity check to me.

Reviewed By: kib, imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D30820

(cherry picked from commit e3be51b2bc7cb41eb9a238cced2ee650d9bb2d41)

Details

Provenance
arichardsonAuthored on Jun 22 2021, 8:09 AM
Reviewer
kib
Differential Revision
D30820: rtld-elf: Check the return value of obj_enforce_relro()
Parents
rG6e2b0498aa70: truss: minor cleanup and pedantic warning fixes
Branches
Unknown
Tags
Unknown