From nobody Fri May 3 23:23:34 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 4VWRgq0x8Yz5Jl68; Fri, 3 May 2024 23:23:35 +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 4VWRgq0Hb4z4kPY; Fri, 3 May 2024 23:23:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714778615; 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=NDr9OUaGXOPTceYRu0HQU4h8v0SqvUP1/bDVCyBFJOc=; b=vf+xbNmG4Sp8/nIu4/IjN9JGmOLkQ1yQFT4E54UeSaRJsy4v7aLf1fbBw52bHS/rEhyOmf K4P3dZU6cp8NMkhJvBdIe+edGKkKAcCO06YnZpwcTsUz5ClDFk0nJATQxOB70WfFP9qQ/S eA8wDm8LXnmG+obLjWi/rYUvySfnnjAH36ofoArXp0UjXcQIJmEyWWnTwQ34QnWPML5yDc IFkFNhw/ZRsRCfv+7cAxERjh06/D1kQb9iqc8NMYmrAK0LiUu7w26x5WGHok4WqT/tX6sU Z+tuCMguwSg/td9oYi8p2Y71CFY0NYMpOnep6nSB6BKRL3LObQkmhsdl4yg/xA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714778615; a=rsa-sha256; cv=none; b=eHKDFmtFIf8ZSJwpE6shjA4LadL9zXD/zhGD7ueaWpa/D15e/+w4zRIsF8lbwlPkpKkO8a D+hQpnWq8oKi6pSqUd5e+IEO43ti+45byK0lcsK0aAUDQNKQW35iIIfnbrBvlF+egf6S6f L4FmfG2FODPl4v1jX+uAj5O5O9/rtTV0rkygGKF4Al2/H3GBvnsmJsnZh9yiI3XC+RRRfo kMjvQ0F2/qbfk2Cju+rpZXZb8GqaZpdRy55HJmg5zNh95v5axIEwEjomUcKfUN9msMjdVD ePhAm7CSrzIqWBsvmtS5t7ODgUa02EQsmF0+Xh2iNup8tPVe+jPYZJWtOXnDhQ== 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=1714778615; 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=NDr9OUaGXOPTceYRu0HQU4h8v0SqvUP1/bDVCyBFJOc=; b=U7/meA2rUuuBQKD52BymQqsQw0rLOrQ/GbhXzqC6q7GduZfAvVnIyCQIhljtG++1phxuiE PEEzFJSUm6PrLYmitwswhqvlf8l4bi4rG02mfJVTlPmSP0kPwZoVhFvn5ITHTabur5OFGr 8/L7g/LHEoss7tqvWK1sU2GvjPXlxjJQtJ/6TJ5iLGaNzSuStYa4HQ5Gz0EDEnApKkzgw7 S11gmqm0Xevb/RM7zZsc0YTZaSCC0YMg2GwO8ph5RvPlCLygkUT0XFcv8fcOw+MLjYS+DD d4dK8KZmE8JlR9SB4qjKwa401TNzYIJXz/nWRkuoKIB5Mp6UsH7/nF+rin60DQ== 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 4VWRgp70D0z15P5; Fri, 3 May 2024 23:23:34 +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 443NNYZK034185; Fri, 3 May 2024 23:23:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 443NNYvh034182; Fri, 3 May 2024 23:23:34 GMT (envelope-from git) Date: Fri, 3 May 2024 23:23:34 GMT Message-Id: <202405032323.443NNYvh034182@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: b27eb9ce96b8 - main - __cxa_thread_call_dtors(3): fix dtor pointer validity check 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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/main X-Git-Reftype: branch X-Git-Commit: b27eb9ce96b838622e125fd969e8dc4914aabe18 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b27eb9ce96b838622e125fd969e8dc4914aabe18 commit b27eb9ce96b838622e125fd969e8dc4914aabe18 Author: Konstantin Belousov AuthorDate: 2024-05-03 09:32:01 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-03 23:23:15 +0000 __cxa_thread_call_dtors(3): fix dtor pointer validity check When checking for the destructor pointer belonging to some still loaded dso, do not limit the possible dso to the one instantiated the destructor. For instance, dso could set up the dtr pointer to a function from libcxx. PR: 278701 Reported by: vd Reviewed by: dim, emaste, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D45074 --- lib/libc/stdlib/cxa_thread_atexit_impl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/stdlib/cxa_thread_atexit_impl.c b/lib/libc/stdlib/cxa_thread_atexit_impl.c index f95384b30347..3123bd12dca8 100644 --- a/lib/libc/stdlib/cxa_thread_atexit_impl.c +++ b/lib/libc/stdlib/cxa_thread_atexit_impl.c @@ -102,7 +102,7 @@ walk_cb_call(struct cxa_thread_dtor *dtor) { struct dl_phdr_info phdr_info; - if (_rtld_addr_phdr(dtor->dso, &phdr_info) && + if (_rtld_addr_phdr(dtor->func, &phdr_info) && __elf_phdr_match_addr(&phdr_info, dtor->func)) dtor->func(dtor->obj); else