prelink: Drop support for it
PATCH 1/2 prelink: Drop support for it
Prelink is being dropped by glibc in 2.36. It already causes issues with binary corruption, has a number of open bugs and is of questionable benefit without disabling load address randomization and PIE executables.
We disabled it by default a while back but left people able to use it. We would be unable to maintain it alone without glibc support so remove the remaining pieces.
Signed-off-by Richard Purdie <[email protected]>
--- meta/conf/distro/include/maintainers.inc | 1 - meta/lib/oe/package_manager/ipk/rootfs.py | 37 ---- meta/lib/oe/utils.py | 11 -- .../0001-Add-MIPS-gnu-hash-support.patch | 110 ----------- .../prelink/prelink/macros.prelink | 5 - .../prelink/prelink/prelink.conf | 18 -- .../prelink/prelink/prelink.cron.daily | 40 ---- .../prelink/prelink/prelink.default | 22 --- meta/recipes-devtools/prelink/prelink_git.bb | 185 ------------------ scripts/sstate-sysroot-cruft.sh | 12 -- 10 files changed, 441 deletions(-) delete mode 100644 meta/recipes-devtools/prelink/prelink/0001-Add-MIPS-gnu-hash-support.patch delete mode 100644 meta/recipes-devtools/prelink/prelink/macros.prelink delete mode 100644 meta/recipes-devtools/prelink/prelink/prelink.conf delete mode 100644 meta/recipes-devtools/prelink/prelink/prelink.cron.daily delete mode 100644 meta/recipes-devtools/prelink/prelink/prelink.default delete mode 100644 meta/recipes-devtools/prelink/prelink_git.bb
meta/conf/distro/include/maintainers.inc +0 -1
@@ -577,7 +577,6 @@ RECIPE_MAINTAINER:pn-popt = "Yi Zhao <[email protected]>" RECIPE_MAINTAINER:pn-powertop = "Alexander Kanavin <[email protected]>" RECIPE_MAINTAINER:pn-ppp = "Hongxu Jia <[email protected]>" RECIPE_MAINTAINER:pn-ppp-dialin = "Hongxu Jia <[email protected]>" -RECIPE_MAINTAINER:pn-prelink = "Mark Hatle <[email protected]>" RECIPE_MAINTAINER:pn-procps = "Alexander Kanavin <[email protected]>" RECIPE_MAINTAINER:pn-pseudo = "Richard Purdie <[email protected]>" RECIPE_MAINTAINER:pn-psmisc = "Alexander Kanavin <[email protected]>"
meta/lib/oe/package_manager/ipk/rootfs.py +0 -37
@@ -145,51 +145,14 @@ class PkgRootfs(DpkgOpkgRootfs): self.pm.recover_packaging_data() bb.utils.remove(self.d.getVar('MULTILIB_TEMP_ROOTFS'), True) - - def _prelink_file(self, root_dir, filename): - bb.note('prelink %s in %s' % (filename, root_dir)) - prelink_cfg = oe.path.join(root_dir, - self.d.expand('${sysconfdir}/prelink.conf')) - if not os.path.exists(prelink_cfg): - shutil.copy(self.d.expand('${STAGING_DIR_NATIVE}${sysconfdir_native}/prelink.conf'), - prelink_cfg) - - cmd_prelink = self.d.expand('${STAGING_DIR_NATIVE}${sbindir_native}/prelink') - self._exec_shell_cmd([cmd_prelink, - '--root', - root_dir, - '-amR', - '-N', - '-c', - self.d.expand('${sysconfdir}/prelink.conf')]) - ''' Compare two files with the same key twice to see if they are equal. If they are not equal, it means they are duplicated and come from different packages. - 1st: Comapre them directly; - 2nd: While incremental image creation is enabled, one of the - files could be probaly prelinked in the previous image - creation and the file has been changed, so we need to - prelink the other one and compare them. ''' def _file_equal(self, key, f1, f2): - - # Both of them are not prelinked if filecmp.cmp(f1, f2): return True - - if bb.data.inherits_class('image-prelink', self.d): - if self.image_rootfs not in f1: - self._prelink_file(f1.replace(key, ''), f1) - - if self.image_rootfs not in f2: - self._prelink_file(f2.replace(key, ''), f2) - - # Both of them are prelinked - if filecmp.cmp(f1, f2): - return True - # Not equal return False
meta/lib/oe/utils.py +0 -11
@@ -537,17 +537,6 @@ class ThreadedPool: for worker in self.workers: worker.join() -def write_ld_so_conf(d): - # Some utils like prelink may not have the correct target library paths - # so write an ld.so.conf to help them - ldsoconf = d.expand("${STAGING_DIR_TARGET}${sysconfdir}/ld.so.conf") - if os.path.exists(ldsoconf): - bb.utils.remove(ldsoconf) - bb.utils.mkdirhier(os.path.dirname(ldsoconf)) - with open(ldsoconf, "w") as f: - f.write(d.getVar("base_libdir") + '\n') - f.write(d.getVar("libdir") + '\n') - class ImageQAFailed(Exception): def __init__(self, description, name=None, logfile=None): self.description = description
meta/recipes-devtools/prelink/prelink/0001-Add-MIPS-gnu-hash-support.patch deleted +0 -110
110 lines not on this page · raw message
meta/recipes-devtools/prelink/prelink/macros.prelink deleted +0 -5
@@ -1,5 +0,0 @@ -# rpm-4.1 verifies prelinked libraries using a prelink undo helper. -# Note: The 2nd token is used as argv[0] and "library" is a -# placeholder that will be deleted and replaced with the appropriate -# library file path. -%__prelink_undo_cmd /usr/sbin/prelink prelink -y library
meta/recipes-devtools/prelink/prelink/prelink.conf deleted +0 -18
@@ -1,18 +0,0 @@ -# This config file contains a list of directories both with binaries -# and libraries prelink should consider by default. -# If a directory name is prefixed with `-l ', the directory hierarchy -# will be walked as long as filesystem boundaries are not crossed. -# If a directory name is prefixed with `-h ', symbolic links in a -# directory hierarchy are followed. --l /usr/local/sbin --l /sbin --l /usr/sbin --l /usr/local/bin --l /bin --l /usr/bin --l /usr/X11R6/bin --l /usr/games --l /usr/local/lib{,32,64,x32} --l /lib{,32,64,x32} --l /usr/lib{,32,64,x32} --l /usr/X11R6/lib{,32,64,x32}
meta/recipes-devtools/prelink/prelink/prelink.cron.daily deleted +0 -40
@@ -1,40 +0,0 @@ -#!/bin/sh - -. /etc/default/prelink - -renice +19 -p $$ >/dev/null 2>&1 - -if [ "$PRELINKING" != yes ]; then - if [ -f /etc/prelink.cache ]; then - echo /usr/sbin/prelink -uav > /var/log/prelink.log - /usr/sbin/prelink -uav >> /var/log/prelink.log 2>&1 - rm -f /etc/prelink.cache - # Restart init if needed - [ -n "$(find `ldd /sbin/init | awk '{ print $3 }'` /sbin/init -ctime -1 2>/dev/null )" ] && /sbin/telinit u - fi - exit 0 -fi - -if [ ! -f /etc/prelink.cache -o -f /var/lib/misc/prelink.force ] \ - || grep -q '^prelink-ELF0.[0-2]' /etc/prelink.cache; then - # If cache does not exist or is from older prelink versions or - # if we were asked to explicitely, force full prelinking - rm -f /etc/prelink.cache /var/lib/misc/prelink.force - PRELINK_OPTS="$PRELINK_OPTS -f" - date > /var/lib/misc/prelink.full -elif [ -n "$PRELINK_FULL_TIME_INTERVAL" \ - -a "`find /var/lib/misc/prelink.full -mtime -${PRELINK_FULL_TIME_INTERVAL} 2>/dev/null`" \ - = /var/lib/misc/prelink.full ]; then - # If prelink without -q has been run in the last - # PRELINK_FULL_TIME_INTERVAL days, just use quick mode - PRELINK_OPTS="$PRELINK_OPTS -q" -else - date > /var/lib/misc/prelink.full -fi - -echo /usr/sbin/prelink -av $PRELINK_OPTS > /var/log/prelink.log -/usr/sbin/prelink -av $PRELINK_OPTS >> /var/log/prelink.log 2>&1 -# Restart init if needed -[ -n "$(find `ldd /sbin/init | awk '{ print $3 }'` /sbin/init -ctime -1 2>/dev/null )" ] && /sbin/telinit u - -exit 0
meta/recipes-devtools/prelink/prelink/prelink.default deleted +0 -22
@@ -1,22 +0,0 @@ -# Set this to no to disable prelinking altogether -# or to yes to enable it. -# (if you change this from yes to no prelink -ua -# will be run next night to undo prelinking) -PRELINKING=yes - -# Options to pass to prelink -# -m Try to conserve virtual memory by allowing overlapping -# assigned virtual memory slots for libraries which -# never appear together in one binary -# -R Randomize virtual memory slot assignments for libraries. -# This makes it slightly harder for various buffer overflow -# attacks, since library addresses will be different on each -# host using -R. -PRELINK_OPTS=-mR - -# How often should full prelink be run (in days) -# Normally, prelink will be run in quick mode, every -# $PRELINK_FULL_TIME_INTERVAL days it will be run -# in normal mode. Comment this line out if prelink -# should be run in normal mode always. -PRELINK_FULL_TIME_INTERVAL=14
meta/recipes-devtools/prelink/prelink_git.bb deleted +0 -185
185 lines not on this page · raw message
scripts/sstate-sysroot-cruft.sh +0 -12
@@ -145,18 +145,6 @@ WHITELIST="${WHITELIST} \ .*/var/cache/fontconfig/ \ " -# created by oe.utils.write_ld_so_conf which is used from few bbclasses and recipes: -# meta/classes/image-prelink.bbclass: oe.utils.write_ld_so_conf(d) -# meta/classes/insane.bbclass: oe.utils.write_ld_so_conf(d) -# meta/classes/insane.bbclass: oe.utils.write_ld_so_conf(d) -# meta/recipes-gnome/gobject-introspection/gobject-introspection_1.48.0.bb: oe.utils.write_ld_so_conf(d) -# meta/recipes-gnome/gobject-introspection/gobject-introspection_1.48.0.bb: oe.utils.write_ld_so_conf(d) -# introduced in oe-core commit 7fd1d7e639c2ed7e0699937a5cb245c187b7c811 -# and more visible since added to gobject-introspection in 10e0c1a3a452baa05d160a92a54b2e33cf0fd061 -WHITELIST="${WHITELIST} \ - [^/]*/etc/ld.so.conf \ -" - SYSROOTS="`readlink -f ${tmpdir}`/sysroots/" mkdir ${OUTPUT}
Signature · 1 line
2.32.0
PATCH 2/2 glibc: Drop prelink patch
With the removal of prelink, we no longer need the glibc patch for it either.
Signed-off-by Richard Purdie <[email protected]>
--- ...ke-_dl_build_local_scope-breadth-fir.patch | 53 ------------------- meta/recipes-core/glibc/glibc_2.34.bb | 1 - 2 files changed, 54 deletions(-) delete mode 100644 meta/recipes-core/glibc/glibc/0025-elf-dl-deps.c-Make-_dl_build_local_scope-breadth-fir.patch
meta/recipes-core/glibc/glibc/0025-elf-dl-deps.c-Make-_dl_build_local_scope-breadth-fir.patch deleted +0 -53
@@ -1,53 +0,0 @@ -From 50b605dece16606dd9d1c737e579c13725eab11d Mon Sep 17 00:00:00 2001 -From: Mark Hatle <[email protected]> -Date: Thu, 18 Aug 2016 14:07:58 -0500 -Subject: [PATCH] elf/dl-deps.c: Make _dl_build_local_scope breadth first - -According to the ELF specification: - -When resolving symbolic references, the dynamic linker examines the symbol -tables with a breadth-first search. - -This function was using a depth first search. By doing so the conflict -resolution reported to the prelinker (when LD_TRACE_PRELINKING=1 is set) -was incorrect. This caused problems when their were various circular -dependencies between libraries. The problem usually manifested itself by -the wrong IFUNC being executed. - -[BZ# 20488] - -Upstream-Status: Submitted [libc-alpha] - -Signed-off-by: Mark Hatle <[email protected]> ---- - elf/dl-deps.c | 14 ++++++++++---- - 1 file changed, 10 insertions(+), 4 deletions(-) - -diff --git a/elf/dl-deps.c b/elf/dl-deps.c -index 087a49b212..c09f9334f2 100644 ---- a/elf/dl-deps.c -+++ b/elf/dl-deps.c -@@ -73,13 +73,19 @@ _dl_build_local_scope (struct link_map **list, struct link_map *map) - { - struct link_map **p = list; - struct link_map **q; -+ struct link_map **r; - - *p++ = map; - map->l_reserved = 1; -- if (map->l_initfini) -- for (q = map->l_initfini + 1; *q; ++q) -- if (! (*q)->l_reserved) -- p += _dl_build_local_scope (p, *q); -+ -+ for (r = list; r < p; ++r) -+ if ((*r)->l_initfini) -+ for (q = (*r)->l_initfini + 1; *q; ++q) -+ if (! (*q)->l_reserved) -+ { -+ *p++ = *q; -+ (*q)->l_reserved = 1; -+ } - return p - list; - } -
meta/recipes-core/glibc/glibc_2.34.bb +0 -1
@@ -42,7 +42,6 @@ SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \ file://0021-eglibc-Resolve-__fpscr_values-on-SH4.patch \ file://0022-eglibc-Forward-port-cross-locale-generation-support.patch \ file://0024-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch \ - file://0025-elf-dl-deps.c-Make-_dl_build_local_scope-breadth-fir.patch \ file://0026-intl-Emit-no-lines-in-bison-generated-files.patch \ file://0027-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch \ file://0028-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch \
Signature · 1 line
2.32.0