Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 Mar 2019 10:12:00 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r345732 - stable/11/libexec/rtld-elf
Message-ID:  <201903301012.x2UAC0gm076644@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Sat Mar 30 10:12:00 2019
New Revision: 345732
URL: https://svnweb.freebsd.org/changeset/base/345732

Log:
  MFC r345620:
  rtld: disable relro enforcement for irelative relocation processing.

Modified:
  stable/11/libexec/rtld-elf/rtld.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/libexec/rtld-elf/rtld.c
==============================================================================
--- stable/11/libexec/rtld-elf/rtld.c	Sat Mar 30 10:04:42 2019	(r345731)
+++ stable/11/libexec/rtld-elf/rtld.c	Sat Mar 30 10:12:00 2019	(r345732)
@@ -2935,14 +2935,14 @@ resolve_object_ifunc(Obj_Entry *obj, bool bind_now, in
 	if (obj->ifuncs_resolved)
 		return (0);
 	obj->ifuncs_resolved = true;
-	if (obj->irelative && reloc_iresolve(obj, lockstate) == -1)
+	if (!obj->irelative && !((obj->bind_now || bind_now) && obj->gnu_ifunc))
+		return (0);
+	if (obj_disable_relro(obj) == -1 ||
+	    (obj->irelative && reloc_iresolve(obj, lockstate) == -1) ||
+	    ((obj->bind_now || bind_now) && obj->gnu_ifunc &&
+	    reloc_gnu_ifunc(obj, flags, lockstate) == -1) ||
+	    obj_enforce_relro(obj) == -1)
 		return (-1);
-	if ((obj->bind_now || bind_now) && obj->gnu_ifunc) {
-		if (obj_disable_relro(obj) ||
-		    reloc_gnu_ifunc(obj, flags, lockstate) == -1 ||
-		    obj_enforce_relro(obj))
-			return (-1);
-	}
 	return (0);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201903301012.x2UAC0gm076644>