From nobody Thu Feb 29 00:26:17 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TlX8B15hxz5ChxW; Thu, 29 Feb 2024 00:26:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TlX894ncQz54kr; Thu, 29 Feb 2024 00:26:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1709166377; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ExkBwCS32yv1LHCrrw1MkfFNrOMldBhNWTCgV/sdeG4=; b=k0FusDtE6OiSjHfu2cqy91erDzqHxZC1viymU4uErod5a++MlN3SDPe85/9/nsYjPiN3y5 h/1E2tMM40NoMrfXHWjlUth3lVCVMEaS9kjsdx+V8tYMY30CybDi+Yl1EtarHmH83KyU5w 7QO4WsFfiM22+SbUp6D3ETzMmpmVhCfKRwNcf1kYaoFoQaepF8cMs2NGHLgT2cF+aDqwXk xtWY1JcU3PScKDeAxKDFfC6eGWOdjnQREPDfM1gxSuevBI8zQTDuPowrdE1VXEXFqUqSSr FwS4MyyOCBVbeKGmzUypuQgecLwDHstc1lNI9xGTnQp2+6e3S3vcqFmTIuytCA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1709166377; a=rsa-sha256; cv=none; b=auzYMErG8jtiDrI3wBvyqZX38cJPJvdMXTPrMdUQAuvJL7gMgVtyoMqu6qRlj93cJ4tQ2Y 7wcRb2L/T+XqhEok6T4L2+su6zvhMPC2QfHTAjfyT1PsXPmT1lZX7/9Kd7VR3pCe8fD//6 LHifaCOEA5Dmre+hECvhOgZBWD6T/zKlUVhKTrJHoSr7O24HjOQ5DENi/RCkLx+osYkTWV muYJvwhS2WYgBPVOKZz0B1Rpamx6I5uP/yJz2EE3OzoLB+4dBI6w5McH7PH2DjBZSnvRUp qTv9IurfwKu8vc3B13xNmEFMA/110yIHr093Sqw0Jo2ukWPRpAqd6vq0fCkcmQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1709166377; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ExkBwCS32yv1LHCrrw1MkfFNrOMldBhNWTCgV/sdeG4=; b=Zr2w+lfQWC76Jl31rKgvyACdsyQuC7azIswOZa6Uww5zQsv9rMeiXmwnkNyLxXRNrtmigw HIn4oNwG5Lstf2dhQnhOTwF59XmLDhJ0rByjBB5ik5tgvA8W0heiCQgb13EAQ/m8Gkxccv fc9hJEbDeYpl9vSVVcfUX/CmsonIu24uGW2eDHR5G0IlHO9DdUKPGd+irrl9laWx2DRJi8 Q/iXoZj8+o5eHvB/z/w/FDgbsX0BTpnoX9eTndvuoqYDBqzTTUhIGl0Yelkf53t4HIPT6j jXdJdr5OjUzh0ao7XFnWsT1FNEYBSZcR5k5lNFnpHK8xiQxmSWq2uJBybByioA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TlX894MmBzKKq; Thu, 29 Feb 2024 00:26:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41T0QHbO096881; Thu, 29 Feb 2024 00:26:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41T0QHq9096878; Thu, 29 Feb 2024 00:26:17 GMT (envelope-from git) Date: Thu, 29 Feb 2024 00:26:17 GMT Message-Id: <202402290026.41T0QHq9096878@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: c4ca9a566068 - stable/13 - rtld: ignore load_filtees() calls if we already loading filtees for the obj List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c4ca9a5660680109ce0f2fda4f0b5188e979cd67 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c4ca9a5660680109ce0f2fda4f0b5188e979cd67 commit c4ca9a5660680109ce0f2fda4f0b5188e979cd67 Author: Konstantin Belousov AuthorDate: 2024-02-13 01:09:03 +0000 Commit: Konstantin Belousov CommitDate: 2024-02-29 00:24:43 +0000 rtld: ignore load_filtees() calls if we already loading filtees for the obj (cherry picked from commit 968a18975adc9c2a619bb52aa2f009de99fc9e24) --- libexec/rtld-elf/rtld.c | 4 +++- libexec/rtld-elf/rtld.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index a4278e70e872..3ef686441fab 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -2616,12 +2616,14 @@ load_filtee1(Obj_Entry *obj, Needed_Entry *needed, int flags, static void load_filtees(Obj_Entry *obj, int flags, RtldLockState *lockstate) { - if (obj->filtees_loaded) + if (obj->filtees_loaded || obj->filtees_loading) return; lock_restart_for_upgrade(lockstate); + obj->filtees_loading = true; load_filtee1(obj, obj->needed_filtees, flags, lockstate); load_filtee1(obj, obj->needed_aux_filtees, flags, lockstate); obj->filtees_loaded = true; + obj->filtees_loading = false; } static int diff --git a/libexec/rtld-elf/rtld.h b/libexec/rtld-elf/rtld.h index 3111e54a2e08..8cf8b2771a24 100644 --- a/libexec/rtld-elf/rtld.h +++ b/libexec/rtld-elf/rtld.h @@ -268,6 +268,7 @@ typedef struct Struct_Obj_Entry { bool on_fini_list: 1; /* Object is already on fini list. */ bool dag_inited : 1; /* Object has its DAG initialized. */ bool filtees_loaded : 1; /* Filtees loaded */ + bool filtees_loading : 1; /* In process of filtees loading */ bool irelative : 1; /* Object has R_MACHDEP_IRELATIVE relocs */ bool irelative_nonplt : 1; /* Object has R_MACHDEP_IRELATIVE non-plt relocs */ bool gnu_ifunc : 1; /* Object has references to STT_GNU_IFUNC */