From nobody Mon Nov 27 21:42:56 2023 X-Original-To: bugs@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 4SfJwd44z4z53Kpj for ; Mon, 27 Nov 2023 21:42:57 +0000 (UTC) (envelope-from bugzilla-noreply@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 4SfJwd2qYVz3C8F for ; Mon, 27 Nov 2023 21:42:57 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1701121377; 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=QgeG3qUZ2Ry+UxN+JzW4mGtq5TAcgxE1V5zij8fK/Dg=; b=mvdyFiBRGd0sZDk6AZHmex42pgkr8P9U+BN3bZcXgZEApG1gOj0hdL9Ks92wbpjAVg4ldP oTnYKNu1tkF7QcWslGpvYZR6HdfGEjRricdhtWMEEVfrfgA1z66AT5NJ+buGlnq19nlfMn ajAY2jBv6xRfg1qu08HjnX44NistkWpBVS/GYW9Yj5JCIEXhivQiyGFM3upQAfkI7N5IM8 zpF8p6VVO0ArV0GCyLGqx17tac7I7mBPKLL3eZgCtsU3CRpakptYiOG4cVjVFRq53yhJlS nKax2H0uXCUPhUl7qrO1iwedLiA/7dn3HvApANNeRSk4TU2yFS+rxYkRBQla+A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1701121377; a=rsa-sha256; cv=none; b=Qv9GpcJO7uMLWTKpEOhC2Px6K5PlFpCbLUhCrRAu9I7rBut7NgapG9mCrAk6ZMJAsk6e1S GRKXPM2eJg27ORyXNpAchl0qOOYI/FKERMDxt8RZ7GQY1dyDRbVItLSUWXu+LKku1wLR/N OmNZVC3nNNTPe467zZ+piU2HSE5BR5q3MD+NE2qjoJugERePDtpQ0rUxwXbvKm1aikdpwR y5uRDDjhZ3aPJvGH4nLK1sU4V0TkvsqPPWCVhdWCc1Ox5iAvpfMCh/wfKWfk8ummxzDDR7 tjbtBhFQ/DynDeuGmD0yEC574DUKogxZzuW2/AsZuBMpGtr0V8yzF2VKwj8WRA== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 4SfJwd1vK6zw1k for ; Mon, 27 Nov 2023 21:42:57 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 3ARLgv0O084453 for ; Mon, 27 Nov 2023 21:42:57 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 3ARLgvpT084452 for bugs@FreeBSD.org; Mon, 27 Nov 2023 21:42:57 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 275393] RTLD_DEEPBIND semantics not quite right Date: Mon, 27 Nov 2023 21:42:56 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: Unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: kevans@freebsd.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D275393 Bug ID: 275393 Summary: RTLD_DEEPBIND semantics not quite right Product: Base System Version: Unspecified Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: kevans@freebsd.org Created attachment 246617 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D246617&action= =3Dedit Minimal reproducer Consider the attached example, with a build.sh to build it: libutil provides get_value, set_value -- it's built into both libutil.so and libutil2.so, two separate libraries with purposefully conflicting symbols libfoo provides print_value (which calls get_value) and links against libut= il2 app links against libutil and dlopens $ORIGIN/libfoo.so with RTLD_DEEPBIND = and calls set_value(5) to get a different value for get_value() On Linux, this prints: % ./app application value 5 library value: 10 On FreeBSD: $ ./app=20=20 application value 5 library value: 5 So under glibc, symbol_lookup from the dlopened image prefers symbols from = the same chain of objects that were loaded at that dlopen time, not just the sa= me image. --=20 You are receiving this mail because: You are the assignee for the bug.=