]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
rtld-elf: Check the return value of obj_enforce_relro()
authorAlex Richardson <arichardson@FreeBSD.org>
Tue, 22 Jun 2021 08:09:44 +0000 (09:09 +0100)
committerAlex Richardson <arichardson@FreeBSD.org>
Mon, 5 Jul 2021 09:46:12 +0000 (10:46 +0100)
commit58137266b6eab0a117878cb40f58bd693ea2396d
treefff02e38de959bb9cc8c2b039c307e2dcf696c4d
parent6e2b0498aa702bace3859273c36bd27d7dff85c3
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)
libexec/rtld-elf/rtld.c