From nobody Sun Feb 18 10:09:11 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 4Td1br3hkrz5C8qW; Sun, 18 Feb 2024 10:09:12 +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 4Td1br14ffz4CnN; Sun, 18 Feb 2024 10:09:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708250952; 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=kiKFirKmd0M3E5UF6F99bAml8jHQvnN5XJLsmYU6M+c=; b=iVh05wjAx5cAckKRAVmasZSLZfCSYpmw+QnYGaIDC4+iv7xzFxKWqMhhaVQMLnoFBeY+Pm upU4i9J1MFUWxSGdIXIIC7nNyvAE743UNvdzUMZxyEedENh7pCDu0TgGCXfqBxQsT8CP3j whEdyzXv5hQGqXof51XewD4s4ydbaZRVQH1cVCJp096rQANXwxBm7LQTSCnDXlNr0imLZc a5lvpQErbi7Cn4zWNifH/fFqoZiPJL0enAaeAQNWg0VMMYe5t4OYM+ZGrBKwumWz43OUiz YUNI+zpzXki5nTI7DSqYsYiJsBipjtoD8hNxSQ4V0dmGXSOS3B3OotYOaD2xVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708250952; 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=kiKFirKmd0M3E5UF6F99bAml8jHQvnN5XJLsmYU6M+c=; b=SCfmHAwRQmyWVP2qaXoJFUaHSm4+hER+NIVLE4IMy1Aa4Up2mGwfGMtz4gzoOthSOh8UQi z+LlKWN4YqSX1SLOMM6uDdeXRmttHoIqqx1cFIZ89uSOwrQyHzrK36RUQp0TfIvuwgWr7s JiATVa9iwImdLTYJ7ojRfCLLm1vnvr9ZHrNJv6MBvWvAy1sqVhwOD65qrK30j8oAMgb7t2 SDzqoWb11A5XnW2eUrZj2fljPwkciIYcRUV8IYaw29w1ZsV+lC6cSrZ3fi3/xu5EZTvNu+ HoRCeYwqjRS4nvaA0wemTwkkEUsyIKX1jouS9lhS3ru6IfNrSKdSnxYTZCNvAQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708250952; a=rsa-sha256; cv=none; b=fm5sh5/MmK+EOciOhu2ZKkyg2Jy04wT4M9y3NeHEqgf0aogCRyDIX0SEPUCbpwjDDe2hJb mABvJSMbmIZKFCzD3FayqHpwn7R9F9LeolNKtL99yKrinyt0TfHwdL/xXRDrHy+xjMnU2Y h6+dp/Lipu5iOrwwQv8J5kxiYmOQAZJrLTqN2b5jzQutKhJz23gpoIt4wMA4MGcdwdna1V bDg3GskdKjXk030D754Z8g1t6YouYn2j0eQwNRV+t8b2WgblNGzJQFT9C0T2rvY3d7/m2A AgOQtici/Rxo6WikGSgrnSsMiFxeJoLmb3V3a0WD3/OWD8zY9ieUJvCbP0haQg== 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 4Td1br0BcfzmYf; Sun, 18 Feb 2024 10:09:12 +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 41IA9BIx086129; Sun, 18 Feb 2024 10:09:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41IA9Bmx086127; Sun, 18 Feb 2024 10:09:11 GMT (envelope-from git) Date: Sun, 18 Feb 2024 10:09:11 GMT Message-Id: <202402181009.41IA9Bmx086127@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: 25bd87539704 - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: 25bd87539704b65a4720c1d46cfec5557c4817de Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=25bd87539704b65a4720c1d46cfec5557c4817de commit 25bd87539704b65a4720c1d46cfec5557c4817de Author: Konstantin Belousov AuthorDate: 2024-02-13 01:09:03 +0000 Commit: Konstantin Belousov CommitDate: 2024-02-18 10:01:47 +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 e71903ba5e12..d32c80debc1d 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -2572,12 +2572,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 c2676f59f32d..c9e0d4ab0525 100644 --- a/libexec/rtld-elf/rtld.h +++ b/libexec/rtld-elf/rtld.h @@ -262,6 +262,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 */