From: deraadt Date: Sat, 5 Nov 2022 18:48:31 +0000 (+0000) Subject: The /var/run/ld.so.hints file is mapped into memory. It is never replaced, X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=1916ec131827e4d1285a290915dc0b7a8120efd0;p=openbsd The /var/run/ld.so.hints file is mapped into memory. It is never replaced, so the mapping can be immutable. ok kettenis --- diff --git a/libexec/ld.so/sod.c b/libexec/ld.so/sod.c index 6774e9e2340..4987c4fd8fb 100644 --- a/libexec/ld.so/sod.c +++ b/libexec/ld.so/sod.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sod.c,v 1.36 2022/01/08 06:49:41 guenther Exp $ */ +/* $OpenBSD: sod.c,v 1.37 2022/11/05 18:48:31 deraadt Exp $ */ /* * Copyright (c) 1993 Paul Kranenburg @@ -186,6 +186,8 @@ _dl_maphints(void) if (hheader->hh_version >= LD_HINTS_VERSION_2) _dl_hint_search_path = _dl_split_path(hstrtab + hheader->hh_dirlist); + _dl_mimmutable(addr, hsize); + /* close the file descriptor, leaving the hints mapped */ _dl_close(hfd);