]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
elf image activator: convert asserts into errors
authorKonstantin Belousov <kib@FreeBSD.org>
Tue, 7 Dec 2021 09:29:53 +0000 (11:29 +0200)
committerKonstantin Belousov <kib@FreeBSD.org>
Sun, 12 Dec 2021 14:28:38 +0000 (16:28 +0200)
commit9cf78c1cf6e8909e4b5eaedeb86482904c0bbdc4
tree10da40a2caceba3944a64fb18276f1a82b6929a8
parentb4b20492cd92b5ca7ff03f4140e88363449d3021
elf image activator: convert asserts into errors

Invalid (artificial) layout of the loadable ELF segments might result in
triggering the assertion.  This means that the file should not be
executed, regardless of the kernel debug mode.  Change calling
conventions for rnd_elf{32,64} helpers to allow returning an error, and
abort activation with ENOEXEC if its invariants are broken.

Reported and tested by: pho
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33359
sys/kern/imgact_elf.c