aboutsummaryrefslogtreecommitdiff
path: root/sys/sys
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2021-07-29 13:46:25 +0000
committerMark Johnston <markj@FreeBSD.org>2021-07-29 13:46:25 +0000
commit9e575fadf491152fb3445d4837d49a9cb87dd6e2 (patch)
tree23c7fca2250038bd91d3c7dc52eccbb9ddb21b73 /sys/sys
parent98bfb9dac28585fb5629c5fc951ce0d83490d446 (diff)
downloadsrc-9e575fadf491152fb3445d4837d49a9cb87dd6e2.tar.gz
src-9e575fadf491152fb3445d4837d49a9cb87dd6e2.zip
link_elf_obj: Invoke fini callbacks
This is required for KASAN: when a module is unloaded, poisoned regions (e.g., pad areas between global variables) are left as such, so if they are reused as KLDs are loaded, false positives can arise. Reported by: pho, Jenkins Reviewed by: kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31339
Diffstat (limited to 'sys/sys')
-rw-r--r--sys/sys/linker.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/sys/linker.h b/sys/sys/linker.h
index a3d5eb0e72cf..2d65630cd66b 100644
--- a/sys/sys/linker.h
+++ b/sys/sys/linker.h
@@ -82,8 +82,10 @@ struct linker_file {
int id; /* unique id */
caddr_t address; /* load address */
size_t size; /* size of file */
- caddr_t ctors_addr; /* address of .ctors */
- size_t ctors_size; /* size of .ctors */
+ caddr_t ctors_addr; /* address of .ctors/.init_array */
+ size_t ctors_size; /* size of .ctors/.init_array */
+ caddr_t dtors_addr; /* address of .dtors/.fini_array */
+ size_t dtors_size; /* size of .dtors/.fini_array */
int ndeps; /* number of dependencies */
linker_file_t* deps; /* list of dependencies */
STAILQ_HEAD(, common_symbol) common; /* list of common symbols */